couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Newson <robert.new...@gmail.com>
Subject Re: Why sequential document ids? [was: Re: What's the speed(performance) of couchdb?]
Date Sat, 28 Feb 2009 12:31:27 GMT
Wouldn't clock correction/manual setting potentially render a
YYMMDDHHMMSS approach collision-prone?

It's an issue I recently faced (though in Java) and the details are
interesting.

On Linux, at least, the kernel is able to access a few different
notions of time, the most typical one is the wall clock, and it's
subject to runtime manipulation. This means, for my case and perhaps
this case, that you can't rely on it to monotonically increase.
Fortunately, there is a way to request access to a monotonically
increasing clock and Java's System.nanoTime().The number is only
usefully locally, which is fine with a v1-style UUID since it encodes
the MAC.

B.

On Fri, Feb 27, 2009 at 6:24 PM, Dean Landolt <dean@deanlandolt.com> wrote:
> On Fri, Feb 27, 2009 at 1:11 PM, Chris Anderson <jchris@apache.org> wrote:
>
>> On Fri, Feb 27, 2009 at 8:23 AM, Paul Davis <paul.joseph.davis@gmail.com>
>> wrote:
>> >
>> > There was talk of switching the internal uuid generationg to a version
>> > 1 style instead of the version 4 (random) style. My suggestion was to
>> > make the _uuids endpoint accept a v=[1|4] url parameter to choose with
>> > a config file default but people seemed to not like that idea.
>> >
>>
>> Now that I've got a better grasp on the why's of each option, I think
>> I'm liking your idea just fine. I think the real resistance was to
>> making an ini setting for it.
>>
>> I wonder if there's a way to get roughly ascending uuids (v1-ish)
>> without the security issues that come from having the originating node
>> permanently inscribed on each document...
>
>
> UUID v1 only _very_ roughly ascends -- it recycles every minute or so. This
> probably wouldn't matter too much though...
>
> Even still, an algo to give you ever-increasing uuids is easy -- just go
> YYMMDDHHMMSS etc. Then you can append something like a UUID v4, or something
> shorter that can still strongly guarantee you uniqueness, and you've got the
> best of both worlds. I think...
>

Mime
View raw message