Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 27476 invoked from network); 23 Jan 2011 05:22:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 23 Jan 2011 05:22:32 -0000 Received: (qmail 93486 invoked by uid 500); 23 Jan 2011 05:22:30 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 93163 invoked by uid 500); 23 Jan 2011 05:22:26 -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 93155 invoked by uid 99); 23 Jan 2011 05:22:25 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 23 Jan 2011 05:22:25 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=10.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of kowsik@gmail.com designates 209.85.214.52 as permitted sender) Received: from [209.85.214.52] (HELO mail-bw0-f52.google.com) (209.85.214.52) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 23 Jan 2011 05:22:19 +0000 Received: by bwz4 with SMTP id 4so2619142bwz.11 for ; Sat, 22 Jan 2011 21:21:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=75c3OVyJUF1DVk6WA03EjSiizfyO8ZIrylxcAafSJQg=; b=P3bxvko3C1vzL1Tp03m8EDpIYEpCep+gjY+P293drO5KgjU67DWKZRF9C2X6+rtfFL G9X3wuzP0Sh8WIPcTH2uarOrnKQQHVnKJABaFFUxcWxz2hrDi/dW0SLh+3Ri0NfQ9fSn z4dpjRzykzO+ZqnsceeVdyhZyMm6DFTwV8rnI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=Y6xH93RH8zXkS9wSj+OuJXAfJfo/k8V52QX78zvbcq0U/jgeA5xZ2nRvktQAUTmsbG ffASgZGVpwvS8gevszPpIC9cZHitflMCRGzrkbUkMeXlavMXMzi+LTqHjfVnfGtKEH7v H4Pn9jUEKb0Irv+K1osrt8s97gmum86VwpDA8= MIME-Version: 1.0 Received: by 10.204.82.84 with SMTP id a20mr2295743bkl.154.1295760117805; Sat, 22 Jan 2011 21:21:57 -0800 (PST) Received: by 10.204.16.68 with HTTP; Sat, 22 Jan 2011 21:21:57 -0800 (PST) Date: Sat, 22 Jan 2011 21:21:57 -0800 Message-ID: Subject: Idea: Piggyback doc on conflict From: kowsik To: user@couchdb.apache.org Content-Type: text/plain; charset=UTF-8 X-Virus-Checked: Checked by ClamAV on apache.org I've been spending a fair bit of time on profiling the performance aspects of Couch. One common recurring theme is updating documents on a write-heavy site. This is currently what happens: PUT /db/doc_id <- 409 indicating conflict loop do GET /db/doc_id <- 200 PUT /db/doc_id <- 201 (successful and returns the new _rev) end until we get a 201 What would be beneficial is if I can request the "current" doc during PUT like so: PUT /db/doc_id?include_doc=true <- 409 conflict (but the 'doc' at the current _rev is returned) This would allow the caller to simply take the doc that was returned, update it and try PUT again (eliminate the extra GET). This is especially valuable when the app is on one geo and the db is in yet another (think couchone or cloudant). 2 cents, K. --- http://twitter.com/pcapr http://labs.mudynamics.com