How to do db snapshotting correctly in dgraph?

I was trying to use DGraph for an online collaborative tool and the edit history tracing should be a really good feature for me, one way I can think of is by combining event sourcing pattern with db snapshotting, so I can let dgraph have an event_id or version_id on the root entity so I can save the snapshots of the it without having to reconstruct the state with CRUD events. Or is there any better approaches for implementing this tracing features?

Hi @Akra, welcome to the community!

To clarify, what you want to do is something like this right?

A -> B -> C -> D -> B

... some time later ...

A_1 -> B_2 -> C -> D_10 -> B_2

If that’s the case, you might want to check out some solutions here : Versioned predicates (it’s currently a feature request, and if your usecase is similar, then you will have added a “vote” to it)

Thanks @chewxy I’m not sure what you meant there. Just imagine people collab on a Google doc like collaborative platforms and sometimes you want to roll back some changes, we can either 1. Construct the sequence of change events and reconstruct the db state from the beginning 2. Get the db state by its snapshot right before the change happened. Had dgraph designed anything close to the use case that can help elegantly solve the problem?