about random-generated keys and UUIDs

Alexander Sicular siculars at gmail.com
Fri Mar 11 06:20:11 EST 2011


I'm fairly certain that this unique method in riak returns a unique  
value that has a collision function within the bounds of sha. Further,  
if you look at the actual implementation details of uuid (in general,  
not specific to erlang) you will notice that all uuid generation  
methods are not created equal.

Best, Alexander.

@siculars on twitter
http://siculars.posterous.com

Sent from my iPhone

On Mar 11, 2011, at 5:16, Antonio Rohman Fernandez <rohman at mahalostudio.com 
 > wrote:

> well, maybe i'm wrong, but i don't think base64 is very collision- 
> free if you have millions of entries in a same bucket... because  
> even your algorithm include some uniqueness on it, base64 encoding  
> it could get into some collision:
>
> base64(superawesomeuniquestring) can be same as base64 
> (anothersuperawesomeuniquestring)
>
> as i said, maybe i'm wrong... but i think base64 is not very  
> trustfull. To me UUID sounds just right.
>
> Rohman
>
> On Fri, 11 Mar 2011 04:54:49 -0500, Alexander Sicular <siculars at gmail.com 
> > wrote:
>
>> 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
>>
> -- 
>
> 	 	Antonio Rohman Fernandez
> CEO, Founder & Lead Engineer
> rohman at mahalostudio.com	 	Projects
> MaruBatsu.es
> PupCloud.com
> Wedding Album
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20110311/7175db2a/attachment.html>


More information about the riak-users mailing list