couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Damien Katz <>
Subject multi-document acid transactions
Date Wed, 09 Apr 2008 17:54:01 GMT
FYI, CouchDB now has multi-document ACID transactions. This were  
checked in last week as part of a larger refactoring.

To do a multi-document update, simply use the bulk update POST option.  
If any document fails to commit due to conflict (or whatever reason),  
then all the documents fail.  You can also delete documents in the  
same bulk transaction, by setting the _deleted member in the document  
to true.

So now if all transactions happen on the single instance, you can use  
bulk transactions and keep relationships and heirarchies amongst  
documents intact at all times. But once the application is  
distributed, then you potentially lose the ACID properties of the  
updates, as the replication system won't preserve the atomicity of the  
multi-document update.

This mean I don't recommend relying on bulk updates to preserve inter- 
document ACID properties in distributed applications, but it's  
workable for applications that use only a single database instance.

View raw message