Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 77617 invoked from network); 7 Nov 2010 09:14:49 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 7 Nov 2010 09:14:49 -0000 Received: (qmail 41829 invoked by uid 500); 7 Nov 2010 09:15:20 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 41556 invoked by uid 500); 7 Nov 2010 09:15:16 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 41548 invoked by uid 99); 7 Nov 2010 09:15:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 07 Nov 2010 09:15:16 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of ido.ran@gmail.com designates 209.85.214.180 as permitted sender) Received: from [209.85.214.180] (HELO mail-iw0-f180.google.com) (209.85.214.180) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 07 Nov 2010 09:15:09 +0000 Received: by iwn37 with SMTP id 37so4938731iwn.11 for ; Sun, 07 Nov 2010 01:14:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:content-type; bh=wCEc/W+syW0idVj6QHSwGlZwf5WCrXHCdnbJCOQTCd8=; b=KExRjibnSoCXaOBInUgdxGKnOuBJ+GBcuT1sHdHByUmA0/3RqZof9Y7qcwQ0EPEeu1 o32UxgZS0+SUiq95cqyfgWYMfdNMyVT1DC5cyPiOLM0wauwLiX+XC7Mrmxaw3FJd9YY7 pcnxldNq+Uu64ITHjkGPQFsdVkPADXoNQBl/8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=ep1QZ5r6KPSsHVRJ1FQqqrkpOzGXOBxyFYUQ5c3zcMArSRi0FpvpVBn+tau9NME9eX mAHWaXyMQwDj+qbPkl4tQseqQ1KyU20Sv2EBq9nx3FhiZcbXvZEaIZbpSyvdn9IuOevW ygd3DOqHPTdqJMZhfg4K6JKRoGoJJYSGgQQIs= Received: by 10.42.175.195 with SMTP id bb3mr2454930icb.94.1289121288900; Sun, 07 Nov 2010 01:14:48 -0800 (PST) MIME-Version: 1.0 Received: by 10.231.144.207 with HTTP; Sun, 7 Nov 2010 01:14:28 -0800 (PST) In-Reply-To: References: From: Ido Ran Date: Sun, 7 Nov 2010 11:14:28 +0200 Message-ID: Subject: Re: Write race conditions, working without _rev To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=90e6ba6e8d967f4ed7049472f059 --90e6ba6e8d967f4ed7049472f059 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi, I think this question raise the general question of "document model" (in th= e same way OO programming has Object Model) and that is "how do you model you document to contain you problem domain including the process of changing those documents". In relation databases we use table diagram and description of transactions to describe it I think we need tools (not has to be software, pen and papar= e are great too) to describe out document oriented database. The question of should you have one document that get updated or several documents which relate using other means is a good question. Ido On Sun, Nov 7, 2010 at 9:15 AM, Benoit Chesneau wrote= : > On Fri, Nov 5, 2010 at 5:44 PM, Michael wrote: > > On Fri, Nov 5, 2010 at 12: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. > > > > True, that is one workflow. I am not too concerned however about > > updates trampling each other each update does not care about previous > > revisions. This isn't people updating objects, but applications To be > > honest, I will catch the conflict and just ignore it because the data > > then is "new enough", however if I wanted the newest data, I would > > have to have: > > > > Read object to get rev > > Try save > > if resource conflict: > > read object for rev again > > try save > > if resource conflict: > > assume newer data and pass > > > > If that happens, I have 4 different hits to the database for nothing. > > On a multithreaded server, this would happen quite frequently. > > > > In my workflow, the ideal situation would be to write once, without a > > read, and for Couch to just accept the change in order. > > > > Is that possible? > > > > Thanks, > > > > Michael > > > > Just use one document per transaction. Then a view to retrieve the > last one 'more recent in your case?). > > - beno=C3=AEt > --90e6ba6e8d967f4ed7049472f059--