couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Newson (JIRA)" <j...@apache.org>
Subject [jira] Commented: (COUCHDB-465) Produce sequential, but unique, document id's
Date Fri, 14 Aug 2009 09:09:14 GMT

    [ https://issues.apache.org/jira/browse/COUCHDB-465?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12743144#action_12743144
] 

Robert Newson commented on COUCHDB-465:
---------------------------------------

I think the odds of generating the same random 12 byte value preclude collisions with enough
probability. A MAC address is 48 bits whereas this prefix is 96 bits. The issue with UUID
v1 is that it includes the time. The precision of the system clock could become the limiting
factor in id generation. The exact algorithm for v1 is not well-specified either.

To say it another way, the 96 random bits at the front are the (temporary) node identifier.



> Produce sequential, but unique, document id's
> ---------------------------------------------
>
>                 Key: COUCHDB-465
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-465
>             Project: CouchDB
>          Issue Type: Improvement
>            Reporter: Robert Newson
>         Attachments: sequence_id.patch, uuid_generator.patch
>
>
> Currently, if the client does not specify an id (POST'ing a single document or using
_bulk_docs) a random 16 byte value is created. This kind of key is particularly brutal on
b+tree updates and the append-only nature of couchdb files.
> Attached is a patch to change this to a two-part identifier. The first part is a random
12 byte value and the remainder is a counter. The random prefix is rerandomized when the counter
reaches its maximum. The rollover in the patch is at 16 million but can obviously be changed.
The upshot is that the b+tree is updated in a better fashion, which should lead to performance
benefits.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message