On Wed, Jul 12, 2017 at 6:41 AM, Lee Hinde via 4D_Tech <4d_tech@lists.4d.com
> wrote:

> On Tue, Jul 11, 2017 at 3:10 AM, David Adams via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
>
> > * Use a header object that describes the 'columns' and then use compact
> > JSON arrays for the data. Rob Laveaux reminded me about this option some
> > months back and it's a really decent compromise.
> >
>
> That seems like a good option - it's the same, mostly, as a TSV/CSV. But it
> seems like JSON isn't appropriate for your storage needs (compactness
> trumps all), irrespective of how 4D stores it internally.
>
>
Hey Lee!

It depends. In the system I just described with
4D+MySQL+Mustache+PHP+DataTables+D3, some of the pre-rendered data was
stored as JSON and some was stored as TSV and converted to JSON on the fly.
The example I brought up here wasn't about my big flabby arrays - there are
lots of ways to rework those. But bytes are bytes. Imagine that you had
100KB of sensible JSON, not silly JSON. It's the behavior of the storage
engine that I'm interested in.

As to storing JSON in a more compact format, well, I think you then lose
all of the nifty search, etc. features that 4D offers. At that point,
there's no strong argument for using JSON at all. I guess it's a bit easier
to parse than plain text, so there's that. Actually, TSV is super easy to
parse.

As far as I can tell, price of admission for the enticing object field
features is that you lay your JSON out as pure name-value pairs (at
whatever level of nesting.) If that's how it works, fine. I just want to
make sure so that I can make the right design choices. I tend to iterate
through implementations from easier to more optimized. This whole question
was just an iteration in that sort of process. Day 1: Stuff everything into
an object field. OMG, it's huge! That's the point where the thread came
in...but now I think I have a grip on the storage costs of JSON (however
formatted) in 4D's engine.
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**********************************************************************

Reply via email to