| ISSUE 173/456 · COMPUTER SCIENCE |
~4 MIN |
FOUNDATION / DATA / PLACEMENT · READING DATE 2027-03-23 · MARCH 2027 — DATA AND HEAT
How a new server avoids reshuffling every record
START HERE
When a storage service gains a computer, it must decide which records should move there. A key is a record’s identifying value. Consistent hashing is a method for assigning keys to computers so that changing the computer set moves only part of the assignments. It gives records and computers positions in a shared circular number space, then uses a fixed direction to choose an owner.
|
/ WHY NOW
Adding capacity can create a large data-movement job before it helps any users. A placement rule that limits reassignment makes gradual growth easier to manage.
|
/ THE IDEA
A hash function turns a key into a repeatable numerical value. Imagine the possible values arranged around a ring, with the largest wrapping back to the smallest. To place a record, start at its hashed position and walk clockwise to the first computer position. Adding a computer inserts a new stopping point. It takes the part of the following computer’s previous range lying before the new position; other ranges remain assigned as before. This ring picture describes a numerical rule. The records are not physically travelling around a circular network.
THE FORMAL IDEA
owner(k) = first server clockwise from h(k)
| k is the record key; h(k) is its hash value, or ring position. owner(k) names the computer selected by the rule. | | For the example, positions run from 0 through 99 and wrap to 0. A server at an exact position owns that position; clockwise means increasing numbers before the wrap. |
|
RUN THE TINY EXAMPLE
Change one thing. Predict what happens.
Servers A, B and C occupy positions 20, 60 and 90. Record positions 10, 40, 80 and 95 go to A, B, C and A respectively. Change the server set by adding D at position 45. Position 40 now goes to D; 10, 80 and 95 stay on A, C and A. One of these four sample records moves.
|
The new computer took positions after 20 through 45, rather than making every record compute an entirely unrelated destination. In this sample only one record lies in that interval. The one-in-four result belongs to these selected points, not a guaranteed movement fraction for all datasets.
/ SO WHAT?
Real designs often give each physical computer many ring positions, called virtual nodes. That can smooth uneven range sizes and make it easier to allocate more work to larger computers. Replication can assign additional owners after the first one. Placement, replication and deciding whether a computer is healthy remain separate design tasks.
ONE CAVEAT |
| A balanced spread of hashed keys does not ensure balanced request traffic: one popular record can still overload its owner. Moving assigned data also needs a safe migration protocol; computing the new owner alone does not make the bytes instantly available there. |
KEEP THIS
A stable placement rule limits growth-related movement to the ranges whose ownership actually changes, instead of reshuffling every key.
|
NEXT: Why a thicker block warms through much more slowly
|