Is there a way to control where data is stored

Florian Odronitz odo at
Fri Jan 7 08:46:15 EST 2011


I am new to riak so I might miss something essential.
As I understand from (, 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) ->    

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/conditions/abc at 123
/riak/actions/xyz at 123

so '123' would be hashed in all cases.

Any thoughts on this are appreciated.

Best Regards,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1524 bytes
Desc: not available
URL: <>

More information about the riak-users mailing list