Hi! I was interested in implementing some form of versioning for node details, and was wondering if it would be more performant to store deltas or snapshots of each node upon a change. In the context of user profiles, for instance, let’s say we have an initial profile:
{
"profileID":"1000",
"details":[
{
"name":"Jake",
"favorite-color":"blue",
"DOB":"11/1/2000",
"timestamp":"100000"
}
]
}
If the user changes their favorite color from blue to red, we could store the changes with a new snapshot of the profile:
{
"profileID":"1000",
"details":[
{
"name":"Jake",
"favorite-color":"blue",
"DOB":"11/1/2000",
"timestamp":"100000"
},
{
"name":"Jake",
"favorite-color":"red",
"DOB":"11/1/2000",
"timestamp":"100023"
}
]
}
However, that results in a high storage cost as the database expands. It would be preferable to just store the changes that were made:
{
"profileID":"1000",
"details":[
{
"name":"Jake",
"favorite-color":"blue",
"DOB":"11/1/2000",
"timestamp":"100000"
},
{
"favorite-color":"red",
"timestamp":"100023"
}
]
}
Is there a performant way to query the state of a user’s profile at a given point of time that would coalesce these deltas into a single node? Alternatively, is there a preferred way of tracking a node’s historical data?