Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it really wrong to version documents using CouchDB's default behaviour?

This is one of those "I know I shouldn't do this but it's oh so convenient." questions. Sorry about that.

I plan to use CouchDB for storing a bunch of documents and keeping their entire revision history. CouchDB does the versioning automatically, but it is strongly discouraged for programmer's use:

"You cannot rely on document revisions for any other purpose than concurrency control."

From what I've found on the CouchDB wiki, the versions can get deleted either during compaction or during replication. As far as I can tell, Compaction must always be triggered manually and Replication occurs only when there's more than one database server.

The question is: if I won't run compaction and will use only single database instance for my documents, can I just use CouchDB's document versioning and expect it to work?

What other problems I might run into? E.g. does not running compaction hurt the performance or consume significantly more disk space (than if I did handle the versioning manually)?

like image 279
Tomas Sedovic Avatar asked Apr 26 '10 23:04

Tomas Sedovic


1 Answers

If you reformulate the sentence a bit, it says: "Any update, regardless how minor can completely change the behavior. We guarantee you can use it for concurrency, but nothing else."

Therefore I would not rely on it because in our industry, stuff like that will haunt you in 6 months, unless you can absolutely guarantee that you never, ever update CouchDB.

like image 188
Michael Stum Avatar answered Nov 15 '22 09:11

Michael Stum