Thank you for this great library!
I would like to evaluate the suitability to implement an in-memory and immutable JSON database for many similar element. This is a specific application but I wonder what Boost.JSON internals to be helpful to make documents share more under the hood.
Previously I implemented an immutable database at document level where each document is hashed and given an unique identifier in the context. The database is designed to keep only one copy of unique documents and returns the existing identifier when the same document is added again.
Yet there is no sharing between documents if they contain the same substructures, which may be possible since Boost.JSON already organizes as json::value trees.
Question: Is there an easy way to create JSON documents that share common substructures, including field keys?
Alternatively: How can I write a custom parser to intern json::values at object creation if possible?
Thank you for this great library!
I would like to evaluate the suitability to implement an in-memory and immutable JSON database for many similar element. This is a specific application but I wonder what Boost.JSON internals to be helpful to make documents share more under the hood.
Previously I implemented an immutable database at document level where each document is hashed and given an unique identifier in the context. The database is designed to keep only one copy of unique documents and returns the existing identifier when the same document is added again.
Yet there is no sharing between documents if they contain the same substructures, which may be possible since Boost.JSON already organizes as
json::valuetrees.Question: Is there an easy way to create JSON documents that share common substructures, including field keys?
Alternatively: How can I write a custom parser to intern
json::values at object creation if possible?