LESSON 07 · Operations

Keep routing trustworthy during change

Version the ring, measure skew, and rehearse data movement before a failure forces it.

SYSTEM VIEW

The placement map

Diagram view
Ring map—
Apps on old map—
Copy—

Watch Node D take over part of Node B’s range while two app servers route by different versions of the map.

  1. Both app servers route by version 41 of the ring map, which gives positions 21 to 50 to Node B. Key 30 hashes into that range, so App 2 reads it from Node B and gets 7.

    Map v41
    21–50 → Node B
    Key 30
    7, on Node B

    What changed

    • Both apps on v41
    • Key 30 = 7 on Node B
  2. Node D joins to take 21 to 35, so Node B first copies that range, 2 TB, to D. The copy is capped at 100 MB/s so it doesn’t starve App 2’s reads, and takes about 5.6 hours, long enough that a node can fail mid-copy: plan for it.

    Range
    21–35 · 2 TB
    Cap
    100 MB/s
    Takes
    about 5.6 hours

    What changed

    • Node D
    • Copy of 21–35, 2 TB
  3. With the copy done, the ring map moves to version 42, which gives 21 to 35 to Node D. App 1 picks up v42, but the update hasn’t reached App 2, which still routes by v41. The two apps now disagree about who owns key 30.

    Map v42
    21–35 → Node D
    App 1
    v42
    App 2
    v41

    What changed

    • Ring map: v41 → v42
    • App 1 on v42
    • App 2 misses v42
  4. App 1 routes by v42 and writes key 30 = 8 to Node D. App 2 routes by v41, reads key 30 from Node B and gets 7, the old value. Nothing tells App 2 it asked the wrong node.

    What changed

    • Key 30 = 8 on Node D
    • App 2 reads 7 from Node B
  5. With a versioned map the mismatch shows: App 2’s read carries v41. Under v42 Node B no longer owns 21 to 35, so it refuses with a redirect, as Redis Cluster’s MOVED and ASK do. The redirect corrects App 2’s map, and it reads 8 from Node D.

    What changed

    • B refuses 21–35
    • App 2 on v42
    • App 2 reads 8 from D
  6. Monitoring tracks what goes wrong during change: apps on an old map version, migration progress, and skew in keys, bytes and requests per node. Where partitions are stable and centrally managed, a fixed map may be simpler: Redis Cluster assigns 16,384 hash slots explicitly.

    Watch
    versions · copy · skew
    Fixed map
    16,384 slots

    What changed

    • Monitoring
    • Traffic split over B and D

Space plays · ← → step · Home resets

THE IDEA

How it works

Track token ownership, key and byte distribution, per-node request rate, hot partitions, migration progress, and routing-version mismatch. If clients disagree about membership, the same key can be written to different owners. Here is the sequence: map v41 says a key belongs to B, and v42 gives it to D. One app server has v42 and writes the key to D. Another still has v41, reads from B, and gets the old value. A versioned routing map and an explicit transition protocol make this observable, and nodes can refuse requests for ranges they no longer own. Redis Cluster does this with MOVED and ASK redirects that correct clients holding a stale map.

During a node failure, do not assume a reassignment has copied durable data; use replicas and repair. Test joins, removals, and interrupted transfers with realistic skew. Bound migration bandwidth so background copying does not starve foreground requests. In an example, a 2 TB transfer capped at 100 MB/s takes about 5.6 hours, so plan for a second failure during that window. Check that replacement nodes have enough disk and that replicas span the intended failure domains.

Consistent hashing is useful when membership changes frequently enough that minimizing remaps matters. A simple fixed partition map may be easier when partitions are stable and centrally managed. Redis Cluster, for instance, assigns 16,384 hash slots to nodes explicitly instead of using a ring.

DECISION POINT

Two app servers disagree about the current token map during a node join. What is the immediate risk?

Write a sentence or two to unlock the guidance. Committing first is what makes it stick.

Keep in mind

  • Observe routing versions, skew, and migration lag.
  • Choose a ring when its movement benefit outweighs its operational cost.
CHECK YOUR UNDERSTANDING

Put it into practice.

1 OF 3
RecallQUESTION 01

Which metric exposes uneven ring ownership?

Choose an answer. You’ll see the explanation once you get it right.

Next chapter: Key-Value Store

0 of 3 checkpoints answered correctly to complete this lesson.