couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From couchdb user <>
Subject Re: Write race conditions, working without _rev
Date Sun, 07 Nov 2010 02:25:24 GMT
To follow up on what Chad said about avoiding reading the doc to get
the _rev, you can also use a HEAD request, while it is an extra
request, it will use a lot less resources.

$ curl -HEAD


On Sat, Nov 6, 2010 at 3:52 PM, Luciano Ramalho <> wrote:
> On Fri, Nov 5, 2010 at 2:03 PM, Paul Davis <> wrote:
>> In the second case, the second person to write the document wins,
>> erasing any changes the first write's effects. The first writer will
>> then be in a state where his view of the database will be
>> inconsistent. The thing his, he can't know because without requiring a
>> _rev token he'll never get a notification of any sort of error.
> As I understand, the situation you describe above never happens in
> practice with CouchDB. A second PUT to the same document _id will
> always require the _rev attribute, so there's no way to overwrite a
> previous update by accident. This is one of the best features of
> CouchDB for document-oriented persistency.
> --
> Luciano Ramalho
> programador repentista || stand-up programmer
> Twitter: @luciano

View raw message