The Cassandra ring, by the walk.
Cassandra is taught as a ring. It’s clearer as a line that wraps. Below, the ring unrolls — and from there we follow a single key all the way through: where it lands, where its replicas live, what happens when machines die, and why R + W > RF is not the same as strong consistency.
§ I.1The ring is just a line that wraps
Cassandra’s token space is a finite range of integers. Every diagram draws it as a circle so that the largest token wraps back to the smallest. The circle does one job: it makes the wrap-around visible. Everything else is easier on a line.
Press Unwrap. The ring rolls flat into a horizontal number line, the four nodes slide into place, and from here on out we’ll think of the token space as a line — with the understanding that it wraps at the right end.
§ I.2From a row to a token to a node
A row’s partition key is hashed into one number — its token. To find the row’s owner, start at that token and walk right along the line until you hit a node’s token. If you fall off the right end, you wrap to the left and keep walking.
Type a key below and press Hash → walk. Try user:42, then user:42 again — same key always lands at the same token, with the same owner. Try zzz to land near the right end and watch the wrap.
§ I.3Vnodes, and what happens when a node joins
With one token per node, adding a new node would mean handing over half of one neighbor’s key range — a lot of data in one place, and the load is wildly uneven. Cassandra fixes this with vnodes: each physical node owns many tokens scattered across the line. Adding a new node sprinkles its vnodes into the gaps, and only the tiny segments directly to the right of those new vnodes change owner.
Press Add a node below to drop a fifth node’s vnodes into the line. Notice that most of the line keeps the color it already had.
§ I.4Replication: just keep walking
A replication factor of RF means a row is stored on RF distinct physical nodes. The first owner is found by the walk from § I.2. The next RF − 1 replicas are found by continuing the walk and picking each new physical node we encounter. Vnodes that belong to a node we’ve already counted are skipped.
§ I.5Failure: which rows go missing
With RF = 1, every node is the only home for some range of keys. Kill a node and that whole range is gone. With RF = 3, a row is stored on three distinct nodes, so one failure loses nothing — you’d have to lose every replica of a row for that row to be unreachable.
Tick the boxes below to kill nodes. Slide the RF slider and watch the orange shading shrink: replication is what makes data survive failures, and the walk’s skip-rule is what makes replication actually use distinct machines.
§ I.6Quorums, and what they don’t promise
If a write reaches W replicas and a read reaches R replicas, and R + W > RF, then the read’s replica set must overlap the write’s replica set on at least one node. The read can see the write, and Cassandra’s last-write-wins picks the newer version. That’s the read-your-write guarantee.
It is not the same as strong consistency. If the cluster was partitioned during the writes, replicas can have legitimately diverged values — different writes on different replicas — and the read still finds them and silently picks one. Press Run conflict scenario to walk through the canonical case (RF=2, W=1, R=2) and watch it happen.
§ I.7The rules to remember
token space : an integer range, drawn as a ring (it's a line that wraps)
walk : right (clockwise), wrapping at the right end
owner : first node-token ≥ key's token
vnodes : many tokens per physical node, for even balance
replicas : keep walking, pick the next RF distinct nodes
QUORUM(RF) : floor(RF / 2) + 1
R + W > RF : read-your-write guarantee (NOT strong consistency)
under partition : replicas may diverge; LWW silently picks one
← back to the atlas · next figure: a Kafka topic, partitioned →