So far, we have discussed documents that represent the current value of our data. But in many cases, data changes over time. How do we know what the previous state of the data was before it was updated? In relational databases, we often create history tables to store these old versions. Fortunately, RavenDB has a much cleaner approach. It has a Versioning bundle that adds support for automatically storing snapshots of documents every time they are changed.
The Versioning bundle will copy the historical documents into a location relative to the document. For example, if we have a document called
pages/1, then older versions would be stored at
pages/1/revisions/2, and so on. You can learn more ...