couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Lehnardt <...@apache.org>
Subject Re: put and no _rev
Date Fri, 06 Mar 2009 19:29:50 GMT

On 6 Mar 2009, at 20:24, aju wrote:

> Jason Smith wrote:
>> aju wrote:
>>> in a RDBMS when you update an existing row (document) it is a  
>>> single step. (there's no revision term here obviously). likewise  
>>> in subversion when you commit an updated document it is a single  
>>> step.
>> Well in a RDBMS if you have a common constraint like uniqueness on  
>> a column, you have to decide whether to INSERT or UPDATE.  So most  
>> likely, you will grab a big lock, SELECT something, process the  
>> data, INSERT or UPDATE, then release the lock.  So that's two  
>> queries as well.
>
> you are right. probably bad example, but i still can't see the  
> argument
> for not just updating a document based on the latest revision. how  
> can it hurt?
>
> hmm, or perhaps instead one could specify a special rev value "latest"
>
> 	PUT /somedatabase/some_doc_id?rev=latest
>

Imagine Wikipedia. You open a page for editing and sit down and write  
a nice and well-researched paragraph about your favourite band. A  
minute before you are done, I open the same page for editing, having  
the same base version that you have. Now you save your page and submit  
your work to Wikipedia. Then I save my changes to the version I know  
is previous, but doesn't include your changes. My change gets saved  
and yours is gone. Using _rev's I can't save my changes unless I get a  
newer version with your changes.

For the record: CouchDB does not store diffs.

Cheers
Jan
--



Mime
View raw message