For versioning, should I store snapshot or document copies?

Hi, welcome.

I recommend reading this thread: How to recover to the specified version

It contains code snippets, links to relevant discussions, and links to example demos.

Since a Doc contains the entire version history, storing multiple copies of the entire Doc at different points in time is not the best approach. You’re better off storing the Doc once, and then storing a snapshot for each point that you would like to be able to restore.

A snapshot is just a state vector + delete set, so it takes up very little space, but it requires an existing YDoc to work.

1 Like