about random-generated keys and UUIDs

Antonio Rohman Fernandez rohman at mahalostudio.com
Fri Mar 11 05:16:20 EST 2011



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  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
[1], 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 [2], 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
[3] ] 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 

		 [4]

ANTONIO
ROHMAN FERNANDEZ
CEO, Founder & Lead Engineer
rohman at mahalostudio.com
[5]		 
PROJECTS
MaruBatsu.es [6]
PupCloud.com [7]
Wedding Album [8]

 
_______________________________________________
riak-users mailing
list
riak-users at lists.basho.com
[9]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

--


		 [10]

ANTONIO ROHMAN FERNANDEZ
CEO, Founder & Lead
Engineer
rohman at mahalostudio.com [11]		 
PROJECTS
MaruBatsu.es
[12]
PupCloud.com [13]
Wedding Album [14]

 

Links:
------
[1]
https://github.com/basho/riak_core/blob/master/src/riak_core_util.erl#L131
[2]
http://en.wikibooks.org/wiki/Erlang_Programming/Terms
[3]
http://server:8098/riak/bucket
[4] http://mahalostudio.com/
[5]
mailto:rohman at mahalostudio.com
[6] http://marubatsu.es/
[7]
http://pupcloud.com/
[8] http://wedding.mahalostudio.com/
[9]
mailto:riak-users at lists.basho.com
[10] http://mahalostudio.com
[11]
mailto:rohman at mahalostudio.com
[12] http://marubatsu.es
[13]
http://pupcloud.com
[14] http://wedding.mahalostudio.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20110311/181117a8/attachment.html>


More information about the riak-users mailing list