The current consistent hashing scheme was chosen because it tends to produce an 
even (random) spread across the cluster. In general, you should want to avoid 
hotspots because they will limit availability and concurrency. However, you are 
free to use a different hashing scheme if you like, as long as it produces keys 
in the same 160-bit keyspace.  You may have noticed there's an example chash 
function riak_core that hashes only the bucket.

Sean Cribbs <[email protected]>
Developer Advocate
Basho Technologies, Inc.
http://basho.com/

On Jan 7, 2011, at 7:46 AM, Florian Odronitz wrote:

> Hello,
> 
> I am new to riak so I might miss something essential.
> As I understand from (http://wiki.basho.com/Replication.html), the decision 
> about where a piece of data is stored depends on the key (and the ring).
> Looking at the source code this is defined in chash.erl as:
> 
> key_of(ObjectName) ->    
>    crypto:sha(term_to_binary(ObjectName)).
> 
> So naming a thing is at the same time saying the data belongs to a certain 
> set of nodes.
> 
> In my application I have a set of buckets, 'users', 'conditions', 'actions'. 
> All conditions and all actions are linked to a particular user and in the 
> vast majority of cases they are loaded in one statement using link walking.
> So when reading the data it would be beneficial to have them stored on the 
> same node in order to minimize inter-node traffic. Writing is not an issue 
> since it happens much less frequently.
> 
> So my question is: What is a good way to specify that certain pieces of data 
> are stored together.
> 
> Intuitively I would patch key_of/1 to allow for something like:
> /riak/users/123
> /riak/conditions/a...@123
> /riak/actions/x...@123
> 
> so '123' would be hashed in all cases.
> 
> Any thoughts on this are appreciated.
> 
> Best Regards,
> Florian_______________________________________________
> riak-users mailing list
> [email protected]
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


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

Reply via email to