couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Noah Slater <nsla...@apache.org>
Subject Re: Does CouchDB check autogenerated document id's?
Date Sat, 03 Jan 2009 13:12:18 GMT
On Fri, Jan 02, 2009 at 04:52:29PM -0800, Chris Anderson wrote:
> On Fri, Jan 2, 2009 at 4:10 PM, Matt Goodall <matt.goodall@gmail.com> wrote:
> > 2009/1/2 Jason Davies <jason@jasondavies.com>:
> >>
> >> On 2 Jan 2009, at 16:11, Paul Davis wrote:
> >>
> >>> Also, as a random aside, why does _uuids require a POST?
> >>
>
> In the normal case you would POST a document to a collection when you
> want the server to choose the final URL. However, intermediaries have
> a habit of retrying POSTs randomly, so when you POST and id-less Couch
> document, occasionally duplicate documents are created. We work around
> this by recommending PUT as the document creation method. Of course
> clients can specify any document id they'd like to, but for
> lightweight clients CouchDB provides the _uuids service.
>
> The POST is pragmatic for cache-control reasons, but also RESTy,
> because it exposes the service that CouchDB uses internally for
> directing document POSTs to new ids. By using the _uuids service,
> clients can become the part of CouchDB that would direct documents to
> URLs in a collection.

I don't agree and I think it should change to GET.

  * You hint that it is to mirror the process required for the creation of
    documents. This is not how we should be designing the interface. UUID
    creation is totally disjoint and should be considered separately.

  * You mention cache-control, but nothing about GET semantics implies
    cacheability so unless there is some major flaw with common UA
    implementations I don't see this as a valid argument.

I would suggest you open a bug for this issue Matt.

-- 
Noah Slater, http://tumbolia.org/nslater

Mime
View raw message