On Wed, Nov 17, 2010 at 5:14 PM, Randall Leeds <[email protected]> wrote:
> On Wed, Nov 17, 2010 at 16:15, Chad George <[email protected]> wrote:
>> I've been wondering about this for a while, when two update requests for the
>> same document come to couchdb nearly simultaneously what exactly happens?
>>
>> Is it possible for both requests to get the same revision of the document to
>> update or is there some mechanism to force the updates to occur in series?
>>
>
> There is a mechanism. The message passing within the Erlang runtime
> guarantee an ordering of messages to the update process.
> It is impossible for both updates to occur.
>

I imagine that first in the queue wins in one instance of couchdb, but
that doesn't tell the whole picture with two writes each on a separate
instance of couchdb.  At least the docs say that the sort order of the
revs (including the md5 of the document), so whichever wins the sort
will be the latest _rev.

You want to design your apps to have as few write conflicts as
possible, but you still need to be able to handle them when they do
happen.

Reply via email to