boostorg / boostorg/json

Share common substructures in JSON documents

Open
#1,155 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
479
Forks
110
Avg merge
10d 3h
Merged PRs (30d)
5

Description

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::value`s at object creation if possible?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.