couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Samuel Newson <>
Subject Re: Modeling Relationships and providing Transactional Integrity
Date Wed, 16 Apr 2014 20:46:39 GMT
_bulk_docs is not transactional at all. all_or_nothing:true used to be but the semantic changed
for the reason Jens notes, it doesn’t work in a sharded context. Now it simply forcibly
introduces conflicts if it has to.


On 16 Apr 2014, at 15:32, Jens Alfke <> wrote:

> 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.]
> —Jens
> 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