Is there a way to control where data is stored
odo at mac.com
Fri Jan 7 08:46:15 EST 2011
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:
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.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 1524 bytes
Desc: not available
More information about the riak-users