Skip to content

Binary backing store #15

@mikee47

Description

@mikee47

The library is in a good place now to consider alternative forms of backing storage. One candidate is a binary storage format.

PR #11 added separate Reader and Writer classes which means we could, for example, receive an update in JSON format but write it to storage in a binary format. And vice-versa.

Advantages

  • Compact
  • Fast

Disadvantages

  • More difficult to accommodate schema changes

One caveat with writing is that the string pool may contain unused items which we don't want to save to storage.
Strings are referenced by their offset in the string pool, so we could add a Compact function to remove unused items and update all StringId references. With #12 we can guarantee there are no other users of the store instance, so this is fine.

Reading a store is probably fairly straightforward since I'd expect storage to reflect the arrangement of the internal rootData, stringPool and arrayPool elements.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions