Quorum sizes

Reads see the latest write when W + R is greater than N. With 3 replicas, W = 1 and R = 3, or W = 2 and R = 2, both work. W = 1 and R = 1 can read a stale copy.

Play a level

See it on the board

The same traffic runs on two boards. The simulator measured both when this page was built.

Board to show
HTTP/2UsersKey-value s…1 vCPU · 1 GB × 3
HTTP/2UsersKey-value s…1 vCPU · 1 GB × 3
R = 1 with one write copy: misses a goal
HTTP/2UsersKey-value s…1 vCPU · 1 GB × 3
HTTP/2UsersKey-value s…1 vCPU · 1 GB × 3
R = 3 reads all copies: meets the goals
See it on the board
Measure Goal R = 1 with one write copy R = 3 reads all copies
Stale reads none 178 Fail 0 Pass
Error rate none 0% Pass 0% Pass
p99 latency under 200 ms 2.4 ms Pass 2.9 ms Pass
CPU use under 85% 1.4% Pass 2.3% Pass
Monthly cost 12 USD/mo 12 USD/mo

Key numbers

Default part values from the catalog. The mini board has 3 replicas that apply a write after 50 ms and 150 ms.
NumberValue
Default read quorum1 replicas
Default write quorum1 replicas
Default replica lag0.1 s
Copies and the write quorumDrag or use arrow keys to change the write quorum

Quorum 2 of 3 · commit 9.0 ms

How it works

With N copies of the data, a write is confirmed after W copies have it. A read asks R copies and takes the newest value. If W + R is greater than N, the set of copies that has the write and the set that is read must share at least one copy. So the read sees the latest write.

In the mini board there are 3 replicas. Followers apply a write after 50 ms and 150 ms. With W = 1 and R = 1, a read can go to a copy that has not applied the write, and the read is stale. With W = 2 and R = 1, the read can still reach the slowest copy after the faster follower confirms. Neither is safe.

Two settings are safe. W = 1 and R = 3 is fastest here, because a write is confirmed at once, but each read asks three copies. W = 2 and R = 2 waits for the second copy on each write and asks two on each read.

The choice moves cost between reads and writes. A read-heavy workload, like 80 percent reads here, may prefer a cheap read and a costly write. A write quorum also decides how many failures a write survives.

Quorums give fresh reads of a key. They do not give a global order of all writes.

In the levels you tune R and W and check stale reads, p99 and CPU.