couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Couchdb Wiki] Update of "DocumentRevisions" by NoahSlater
Date Mon, 14 Apr 2008 14:48:27 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Couchdb Wiki" for change notification.

The following page has been changed by NoahSlater:
http://wiki.apache.org/couchdb/DocumentRevisions

The comment on the change is:
Reworded for clarity, added patterns

------------------------------------------------------------------------------
  == Overview ==
  
- CouchDB does not overwrite updated documents in place, instead it creates a new document
at the end of the database file, with the same `_id` but a new `_rev` identifier. Document
revisions are also used to handle conflicting updates. Outdated revisions are not exposed
to views. Conflicts may be resolved by your application, the default conflict resolution scheme
is to use the potential candidate that made the most changes to the subject document.
+ CouchDB does not overwrite updated documents in place, instead it creates a new document
at the end of the database file, with the same `_id` but a new `_rev` identifier. This type
of storage system is space-wasteful so regular ["Compaction"] is needed to reclaim disk space.
Note that the older revisions are not available to ["Views"].
  
- The storage system is disk-wasteful so ["Compaction"] is needed. The revisions are not,
at least at this point, meant to implement revision control systems, they rather exists for
the optimistic concurrency control that allows any number of parallel readers while serialised
writes are happening and to power replication.
+ Document revisions are used for optimistic concurrency control. If you try to update a document
using an old revision the update will be in conflict. These conflicts should be resolved by
your client, usually by requesting the newest version of the document, modifying and trying
the update again.
  
+ @@ How does this relate to replication conflicts?
+ 
+ === Revision History ===
+ 
+ '''You cannot rely on document revisions for any other purpose than concurrency control.'''
+ 
+ Due to compaction, revisions may disapear at any time. You cannot use them for a client
revision system.
+ 
+ If you wish to implement revisions in your client system a number of patterns have been
suggested:
+ 
+  * Using attachments to store old revisions.
+  * Using multiple documents to store old revisions.
+ 
+ @@ Please add to this list and flesh out the solutions as you see fit.
+ 

Mime
View raw message