couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <>
Subject [Couchdb Wiki] Update of "HttpGetUuids" by NuuttiKotivuori
Date Tue, 07 Sep 2010 20:28:55 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Couchdb Wiki" for change notification.

The "HttpGetUuids" page has been changed by NuuttiKotivuori.


  ||'''Query args'''||count='''n'''||How many UUIDs to generate ''(optional, default '''1''')''||
+ ||'''Request body'''||<-2>None||
+ ||'''Response body'''||<-2>JSON document containing a list of generated UUIDs||
+ == Description ==
+ Returns a list of generated UUIDs. CouchDB generated UUIDs are of all lowercase strings
of 32 characters; they do not conform to the UUID standard. They are obtained from through
this API, and automatically used when using POST to add articles to a database, but are not
otherwise used anywhere. The generated UUIDs are not checked for uniqueness. In the (very
unlikely) case of where there is a duplicate, this is expected to be resolved when documents
are inserted in to the database.
+ CouchDB has three different UUID generation algorithms:
+  * {{{random}}}: 32 hex characters generated completely at random.
+  * {{{sequence}}}: 26 hex character random prefix, followed by 6 hex characters of sequence,
which is incremented by random amounts. When the 6 character sequence overflows, a new random
prefix is chosen. There are no guarantees of ordering, but most inserted documents will be
sequentially ordered. This improves insert speed as most B-tree edits do not happen randomly.
Also, if the documents are likely to be accessed sequentially, this improves access speeds.
+  * {{{utc_random}}}: First 14 hex characters are microseconds since Jan 1, 1970 (Unix epoch),
followed by 18 random hex characters.
+ The UUID generation algorithm is specified in CouchDB configuration as {{{uuids/algorithm}}}.
+ == Example ==
+ {{{
+ GET /_uuids HTTP/1.1
+ }}}{{{
+ HTTP/1.1 200 OK
+ Pragma: no-cache
+ Expires: Fri, 01 Jan 1990 00:00:00 GMT
+ Cache-Control: must-revalidate, no-cache
+ {"uuids":["0992c54b79c5f8c603947c67a00002d2"]}
+ }}}

View raw message