Version controlling a predicate

I have a use case where users will spend a significant amount of time editing content in the graph which gets stored in a “Description” predicate. Because this represents valuable work, we need the ability to version control the value of this predicate to allow rolling back to previous versions in the event of content loss. This would be similar, but less ambitious, to a more global graph version control solution as suggested at http://discuss.dgraph.io/t/version-controlling-the-graph/1789.

Any ideas about how to accomplish this in the short term (in 0.83 or 0.9)? I guess one solution would be to implement my own version control solution and serialize / deserialize to and from the string value in the Dgraph predicate. (This brings up another question I had… what if there were a predicate type that could store a byte array for storing arbitrary data.)

Any creative thoughts would be appreciated!

When we built the Stack Overflow demo, we used intermediate nodes as versions, and attached timestamp to the nodes. We could then sort these nodes by decr timestamp, picking the first one gave us the latest version of the data.

You could do something similar to that. The idea being, instead of connecting text directly to node X, have a node Y in between. So, X --> Y --> "text". Also, Y --> edit timestamp, to allow sorting of Ys, to find the latest one / control the versioning.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.