Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CouchDB versioning strategy

Tags:

Would the following be a viable strategy for implementing versioning(using "example" as a sample document type):

Have one original document where the type field is named example_original.

Subsequent changes to the document all have type example_change and the id of example_original document as a key. The change would also carry a timestamp.

Keep one doc with type example_current that is the result of example_original with all example_change "applied". A new example_change document would automatically be applied to this document.

Finding a specific version would consist in retrieving the example_original doc and applying the desired changes (mostly up to a certain timestamp, but it could also be a number of changes).

I should mention that my use-case will involve a limited number of changes to the original. Most updates will consist of new original documents. While this is my current use-case I would also be interested in issues that would result if many changes where involved.

What pros and cons do you see in this approach?

like image 956
mac Avatar asked Aug 26 '09 11:08

mac


1 Answers

Simple Document Versioning with CouchDB

The versioning as attachments approach described in this article should fit most people's requirements for versioning.

like image 85
andyuk Avatar answered Sep 21 '22 22:09

andyuk