Remix.run Logo
eliasdejong a day ago

Lite³: a binary format encoding JSON documents as a serialized B-tree, making it possible to construct iterators on them directly and query internal fields at indexed speeds. It is still a serialized document (possible to send over a network), though now you don't need to do any parsing, since the document itself is already indexed.

https://github.com/fastserial/lite3

Retr0id a day ago | parent [-]

Very interesting. How does it deal with "holes" left by deletions/edits, is there an equivalent of VACUUM?

eliasdejong a day ago | parent [-]

When overwriting fixed-sized values like integers or floats, the old value can simply be overwritten. Holes are only left if the overriding values do not fit in the old location (strings, byte arrays).

To clean up unused space, you start an iterator at the root of the document and recursively write to a new buffer. This will clean up all the unused space. This operation can be delayed by the application for as long as they wish, until the size trade-off outweighs the cost of rebuilding.