by dragonwriter · 6y ago · 0 comments
Also, like XML (definitely not space efficient) with SAX parsers, plain JSON has streaming processors available. They are naturally more complex than streaming processors for line-oriented formats, but they exist, so plain JSON, either array of arrays objects with the main data in array of array is an alternative, e.g.:
{
"headers": [...],
"body": [
[...],
[...],
...
]
}
the last form is also trivially extensible to support other keys for additional metadata, without harming the ability of applications without knowledge of the other keys to process the main data ["name","address"]
["Bob","1 Apple Street"]
["John","2 Apple Street"]
It's compatible with JSON Lines, and mostly equivalent to CSVs, at least how they are most commonly used.