couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nolan Lawson (JIRA)" <>
Subject [jira] [Commented] (COUCHDB-2065) Overwrite a document with a single request
Date Fri, 21 Feb 2014 19:17:22 GMT


Nolan Lawson commented on COUCHDB-2065:

The "retry my change" rather than "retry my document" model sounds like a good fit for CouchDB,
and probably a more robust feature than what I've proposed here.  My main takeaway is that
this feature is not really possible as a URI request parameter, since it can't coexist with
non-forced updates that are generating conflicts.  On the other hand, you could imagine configuring
CouchDB system-wide to run in "single-lineage" mode, where there are no conflicts and the
latest revision always wins, but at that point you might as well be using a different database.

I guess I'd just like to point out that not everybody is using CouchDB because it handles
revisions/replication/eventual consistency so well, but rather because it has a really sweet
HTTP API that fits well with web applications.  Web devs are much more accustomed to the mental
model of "overwrite this doc, revision history be damned" (e.g. localStorage, IDB).  It'd
be nice if Couch could support that without betraying its core philosophy, but based on this
discussion that doesn't seem very likely.

> Overwrite a document with a single request
> ------------------------------------------
>                 Key: COUCHDB-2065
>                 URL:
>             Project: CouchDB
>          Issue Type: New Feature
>      Security Level: public(Regular issues) 
>            Reporter: Nolan Lawson
> It would be convenient to have the option to overwrite documents with a single request,
rather than having to GET, check the _rev, POST/PUT, possibly deal with conflicts, and then
continue POST/PUTing until success.  It could be something as simple as:
> {code}
> PUT localhost:5984/mydb/mydoc?force=true 
> {code}
> If two callers attempt to update the same document at the same time, whoever gets there
last would win.
> Prompted by a [discussion in PouchDB|].

This message was sent by Atlassian JIRA

View raw message