From user-return-16883-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Thu Jun 30 01:09:26 2011 Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6DEE94240 for ; Thu, 30 Jun 2011 01:09:26 +0000 (UTC) Received: (qmail 50952 invoked by uid 500); 30 Jun 2011 01:09:24 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 50899 invoked by uid 500); 30 Jun 2011 01:09:24 -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 50891 invoked by uid 99); 30 Jun 2011 01:09:24 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Jun 2011 01:09:23 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [209.85.210.180] (HELO mail-iy0-f180.google.com) (209.85.210.180) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Jun 2011 01:09:18 +0000 Received: by iyh42 with SMTP id 42so3029811iyh.11 for ; Wed, 29 Jun 2011 18:08:56 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.113.214 with SMTP id b22mr1238244ibq.102.1309396136503; Wed, 29 Jun 2011 18:08:56 -0700 (PDT) Received: by 10.231.79.194 with HTTP; Wed, 29 Jun 2011 18:08:56 -0700 (PDT) In-Reply-To: References: <7800EECA-326D-46C2-B283-E37636EBD2F4@mooseyard.com> Date: Thu, 30 Jun 2011 02:08:56 +0100 Message-ID: Subject: Re: Are server-generated doc IDs better? From: Dale Harvey To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=0016e6471bd096287504a6e38b54 X-Virus-Checked: Checked by ClamAV on apache.org --0016e6471bd096287504a6e38b54 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable CouchDB generates uuid's that attempts to minimise the amount of rebalancin= g that needs to happen on insert, however thats only an optimization I would worry about if you are under fairly severe load. If your application has natural id's then I would use them, if not then I think its fine to use POST as long as you aware of the idempotent issue Cheers Dale On 27 June 2011 18:44, Mark Hahn wrote: > I had to patch jquery.couch.js that comes with couch to use post. It > was using a synchronous ajax call to get uuids which is a big no-no, > especially since I am using the same code on node. > > On Sun, Jun 26, 2011 at 2:25 PM, Jens Alfke wrote: > > If my client code has access to a ready supply of unique ID strings (in > my case, Cocoa=92s CFUUID API), is there any disadvantage to using those = to > create document IDs, versus using IDs generated by the server=92s /_uuids > endpoint? > > > > On a similar note, if I=92m talking to a server on localhost (from a > mobile/desktop app) is there any reason not to use POST to create new > documents? The warning in the docs seems to apply only if there are > intermediate proxies that might repeat the request. > > > > =97Jens > > > > -- > Mark Hahn > Website Manager > mark@boutiquing.com > 949-342-4246 > --0016e6471bd096287504a6e38b54--