Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 49193 invoked from network); 25 Mar 2009 19:12:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 25 Mar 2009 19:12:33 -0000 Received: (qmail 88177 invoked by uid 500); 25 Mar 2009 19:12:33 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 88114 invoked by uid 500); 25 Mar 2009 19:12:33 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 88104 invoked by uid 99); 25 Mar 2009 19:12:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Mar 2009 19:12:33 +0000 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [209.68.5.17] (HELO relay03.pair.com) (209.68.5.17) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 25 Mar 2009 19:12:25 +0000 Received: (qmail 29027 invoked from network); 25 Mar 2009 19:12:02 -0000 Received: from 96.33.90.152 (HELO ?192.168.1.195?) (96.33.90.152) by relay03.pair.com with SMTP; 25 Mar 2009 19:12:02 -0000 X-pair-Authenticated: 96.33.90.152 Message-Id: From: Damien Katz To: dev@couchdb.apache.org In-Reply-To: <49CA2879.3070502@timparkin.co.uk> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v930.3) Subject: Re: Restricting user interactions to a single document -- was [VOTE] Apache CouchDB 0.9.0 release Date: Wed, 25 Mar 2009 15:12:01 -0400 References: <20090324140050.GA17574@tumbolia.org> <49C9776E.1060804@timparkin.co.uk> <49CA1307.7060300@timparkin.co.uk> <49CA2879.3070502@timparkin.co.uk> X-Mailer: Apple Mail (2.930.3) X-Virus-Checked: Checked by ClamAV on apache.org On Mar 25, 2009, at 8:50 AM, Tim Parkin wrote: > Chris Anderson wrote: > -- aa -- >> >> I think I understand the issue. I think there are two ways to >> approach >> a solution. One is to confine end-user updates to a single key. This >> approach is the classic model for key/value stores. > > Pretty unfeasible I would think.. > >> If your domain requires that edits are saved in multiple documents, >> the complexity grows. If you can control replication, and ensure that >> each user has a node to themselves, then you can treat edits between >> replications as a transaction, and the application can roll back any >> thing that has happened since the last outbound replication. It would >> require a library between the UI and storage if you want to make that >> simple for the user. >> > > Fairly unfeasible for a database with 1m+ users.. and I imagine it > won't > be particularly fast to re-replicate the whole db on failure. > >> If you are working in an environment where the application can't >> treat >> replication as a (soft) transaction boundary (hot-swap, or multiple >> concurrent users) then you'll need to break updates out into >> individual documents. A user can start an interactive transaction, >> and >> mark all updates with the transaction id. Then you can use a view to >> show only updates that are associated with a closed transaction. >> >> In this explicit-transaction use case, non-committed updates may be >> replicated, and it is the responsibility of the application to read >> data through a view which only shows updates that belong to finished >> transactions. >> > > Which isn't particularly straightforward either and you lose lots of > couchdb features (like conflict management) plus, as you say, you need > to monitor replication etc.. > >> The upshot is that bulk_docs can't and shouldn't give you any powers >> that you don't have available with the individual document APIs, but >> that doesn't mean your application can't provide those sorts of >> interfaces. > > The upshot appears to be that CouchDB is limited to only changing a > single document at a time through a user interface (unless you want to > add lots of work to handle conflicts).. Could I have a confirmation of > this so I can blog about it. That pretty much true, CouchDB offers no inter-document consistency guarantees. > It's a pretty fundamental restriction and > one I'm sure people who want to use CouchDB would want to know about. You could help by updating the wiki documentation to make this clearer. Multiple places if necessary. -Damien