A simple explanation of Rings in Riak?

Bryan Fink bryan at basho.com
Tue Feb 9 18:20:23 EST 2010


On Tue, Feb 9, 2010 at 1:49 PM, Zubair Quraishi <zubairq at gmail.com> wrote:
> I'm trying to understand what the "rings" in Riak are, but I can't seem to find a clear explanation (please don't just link me to a web site, I have already read what is on the web). As far as I understand a node in Riak is a partition in a ring. Is that correct?

This is the answer I gave on your StackOverflow question:

I know you've said you read everything on the web already, but for
others also reading this question, I'd like to post two resources that
discuss Riak's "ring":

http://riak.basho.com/arch.html

http://riak.basho.com/edoc/architecture.txt

With that out of the way, Riak uses the word "ring" in two places. The
first is to describe the hash space that is used for determining where
to store data. The reason Riak calls that space a ring is that the
last value in the space (2^160-1) is thought of as being adjacent to
the first value in the space (0). Replicas of data are stored in the
"next N partitions" of the hash space, following the partition to
which the key hashes. Considering the hash space as a ring gives a
convenient definition for the "next parition after the final
partition."

The other use of the word "ring" is related to, but not exactly the
same as the former. I mentioned partitions: each node claims several
segments of the hash space, called partitions. Knowledge about which
node has claimed which partition is stored in a structure that Riak
calls the "ring state", or sometimes just the "ring." Other cluster
metadata may also be kept in the ring state, because it's a
conveniently shared piece of data throughout the cluster.

In general usage, an application shouldn't need to think about the ring much.

Any other details I can provide?

-Bryan




More information about the riak-users mailing list