incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Victor Kabdebon <victor.kabde...@gmail.com>
Subject Re: unique key generation
Date Mon, 07 Feb 2011 22:11:06 GMT
Hello Kallin.
If you use timeUUID the chance to generate two time the same uuid is the
following :
considering that both client generate the uuid at the *same millisecond*,
the chance of generating the same uuid is :

1/1.84467441 × 1019Which is equal to the probability for winning a national
lottery for 1e11 days in a row ( for 270 million years).
Well if you do have a collision you should play the lottery :).

Best regards,
Victor Kabdebon
http://www.voxnucleus.fr

2011/2/7 Kallin Nagelberg <kallin.nagelberg@gmail.com>

> Hey,
>
> I am developing a session management system using Cassandra and need
> to generate unique sessionIDs (cassandra columnfamily keys). Does
> anyone know of an elegant/simple way to accomplish this? I am not sure
> about using time based uuids on the client as there a chance that
> multiple clients could generate the same ID. I've heard suggestions of
> using zookeeper as a source for the IDs, but was just hoping that
> there might be something simpler for my purposes.
>
> Thanks,
> -Kal
>

Mime
View raw message