incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Newson <rnew...@apache.org>
Subject Re: Size of couchdb documents
Date Fri, 16 Mar 2012 15:30:39 GMT
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 <kxepal@gmail.com> wrote:
> On Fri, Mar 16, 2012 at 7:09 PM, Robert Newson <rnewson@apache.org> 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 document will
be created. Otherwise the doc’s _id will be used to identity the document to create or update.
Trying to update an existing document with an incorrect _rev will raise a ResourceConflict
exception.
>
>> Note that it is generally better to avoid saving documents with no _id and instead
generate document IDs on the client side. This is due to the fact 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.
>
> --
> ,,,^..^,,,

Mime
View raw message