couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jens Alfke <>
Subject Re: Modeling Relationships and providing Transactional Integrity
Date Wed, 16 Apr 2014 14:32:58 GMT

On Apr 15, 2014, at 8:59 PM, Suraj Kumar <> wrote:

>>   - To modify an attribute that is involved in a relationship, a
>>   "transactional update" API must be used. All the related documents for
>>   those change(s), must also be submitted through this API "bulk_doc"-like
>>   API (perhaps bulk_docs itself?).

I don’t think _bulk_docs will provide a transactional update even on a single shard/node
— the semantics will be the same as issuing a bunch of individual PUT requests one after
the other, i.e. someone else can sneak in and update a doc in between two of your updates.
There are warnings about this in the API docs (at least there were in the old docs; haven’t
checked the new ones.) 

There used to be an “all or nothing” mode to _bulk_docs a long time ago that did provide
a transactional update, but apparently it was removed because it couldn’t be supported in
a clustered environment (BigCouch).

[The usual disclaimer: I’m not familiar with the code inside CouchDB, only its behavior.]


PS: Removing the dev@ group from the reply because (a) I’m not subscribed to that, and (b)
it’s off-topic.
View raw message