about random-generated keys and UUIDs

Alexander Sicular siculars at gmail.com
Fri Mar 11 04:54:49 EST 2011


Those random keys are not as random as you may think they are at first blush. If you look at the actual code, https://github.com/basho/riak_core/blob/master/src/riak_core_util.erl#L131, you will see that it is a base62 encoded sha hash of a unique reference within the erlang runtime, http://en.wikibooks.org/wiki/Erlang_Programming/Terms, and now(), aka. the time.

Cheers,
-Alexander Sicular

@siculars

On Mar 10, 2011, at 10:12 PM, Antonio Rohman Fernandez wrote:

> When posting data to a bucket without specifying a key [ http://server:8098/riak/bucket ] a random-generated key like [ GRwdM5bCPqSdsDa06j5cFNl3i2D, ChVD156ynnfXoZK7Pw9OMGoxUYX, etc... ] is generated... however, shouldn't it be better that Riak generates UUIDs instead of a medium-length random string? using this keys i'm afraid of collisions if a bucket has many items... how collision-free is that algorithm? UUID was specifically created for that purpose, so i think it could be good Riak adopts this system in future versions. any plans for that?
> 
> Rohman
> 
> 		Antonio Rohman Fernandez
> CEO, Founder & Lead Engineer
> rohman at mahalostudio.com	 	Projects
> MaruBatsu.es
> PupCloud.com
> Wedding Album
> 
> _______________________________________________
> riak-users mailing list
> riak-users at lists.basho.com
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20110311/9a1f7bf0/attachment.html>


More information about the riak-users mailing list