From user-return-20085-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Fri Mar 16 15:30:42 2012 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 2409A919A for ; Fri, 16 Mar 2012 15:30:42 +0000 (UTC) Received: (qmail 51915 invoked by uid 500); 16 Mar 2012 15:30:40 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 51874 invoked by uid 500); 16 Mar 2012 15:30:40 -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 51866 invoked by uid 99); 16 Mar 2012 15:30:40 -0000 Received: from minotaur.apache.org (HELO minotaur.apache.org) (140.211.11.9) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Mar 2012 15:30:40 +0000 Received: from localhost (HELO mail-iy0-f180.google.com) (127.0.0.1) (smtp-auth username rnewson, mechanism plain) by minotaur.apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Mar 2012 15:30:40 +0000 Received: by iage36 with SMTP id e36so7413120iag.11 for ; Fri, 16 Mar 2012 08:30:39 -0700 (PDT) MIME-Version: 1.0 Received: by 10.50.186.197 with SMTP id fm5mr20439739igc.1.1331911839760; Fri, 16 Mar 2012 08:30:39 -0700 (PDT) Received: by 10.42.99.195 with HTTP; Fri, 16 Mar 2012 08:30:39 -0700 (PDT) In-Reply-To: References: <003240CB-2132-439B-AD7D-6AFBB00DA352@apache.org> Date: Fri, 16 Mar 2012 15:30:39 +0000 Message-ID: Subject: Re: Size of couchdb documents From: Robert Newson To: user@couchdb.apache.org Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Ah, thanks, that's good advice. You can still grab a bunch of the uuids from /_uuids and then use them, thus giving you good uuids and idempotency too. b. On 16 March 2012 15:17, Alexander Shorin wrote: > On Fri, Mar 16, 2012 at 7:09 PM, Robert Newson wrote= : >> That advice probably dates to when we made a fully random UUID. > > That advice based on wiki note: > http://wiki.apache.org/couchdb/HTTP_Document_API#POST > > ...and fully explained in method description: > >> If doc has no _id then the server will allocate a random ID and a new do= cument will be created. Otherwise the doc=92s _id will be used to identity = the document to create or update. Trying to update an existing document wit= h an incorrect _rev will raise a ResourceConflict exception. > >> Note that it is generally better to avoid saving documents with no _id a= nd instead generate document IDs on the client side. This is due to the fac= t that the underlying HTTP POST method is not idempotent, and an automatic = retry due to a problem somewhere on the networking stack may cause multiple= documents being created in the database. > > If docid is specified on client, PUT request is used instead of POST > one. Workaround is already known: use /_uuids server resource for doc > ids source, but implementing this trick on library level is not good > idea due to it force to produce additional requests behind of scene. > > -- > ,,,^..^,,,