System Designcalculator

Replication quorum calculator

A replicated store keeps N copies of each item. A write is acknowledged once W replicas have it, and a read waits for R replicas to answer. The numbers you pick for R and W decide whether a read is guaranteed to see the latest write, how many replicas can fail, and how long you wait.

Reads see the latest write

Every read reaches at least 1 replica with the latest write, and reads and writes both keep working with 2 replicas down.

Failures tolerated2Reads 2 (N − R) · writes 2 (N − W)

One write and one read across 5 replicas

Replica 1WriteReplica 2WriteReplica 3Write + readReplica 4ReadReplica 5Read
The write is acknowledged by 3 replicas (1, 2, 3). The read asks 3 replicas (3, 4, 5), chosen to share as few as possible with the write. Replica 3 is in both, so the read sees the new value.
Reads see the latest writeYesR + W = 6 > N = 5
Writes overlapYes2W = 6 > N = 5
Chance a read misses a new write0%The sets must share a replica

Your setup

Copies of each item.

Replicas that must answer a read.

Replicas that must acknowledge a write.

Majority both ways uses ⌊N/2⌋ + 1 for R and W, the QUORUM level in Cassandra.

The rules

Quorum rules for the chosen N, R and W
RuleCheckResult
Read and write sets overlapR + W > N: 6 > 5Yes, by at least 1 replica
Two writes overlapW > N / 2: 3 > 2.5Yes
Majority of N⌊N / 2⌋ + 13
Reads surviveN − R2 replicas down
Writes surviveN − W2 replicas down
Overlap is necessary, not sufficient

R + W > N guarantees that a read contacts at least one replica that acknowledged the write. It does not by itself make a store linearizable: sloppy quorums, partial writes that failed and concurrent writes can all still return older or conflicting values.

What it shows

A replicated store keeps N copies of each item. A write is acknowledged once W replicas have it, and a read waits for R replicas to answer. Your choice of R and W decides whether a read sees the latest write, how many replicas can fail, and how long you wait.

Choose N, R and W, or start from a preset. The tool checks the overlap rules, counts tolerated failures, draws an example write and read, and can estimate latency.

How to read it

  • Reads see the latest write when R + W > N. Otherwise the chance of a miss is C(N − W, R) / C(N, R), assuming the read picks R replicas at random.
  • Writes overlap when W > N / 2. If not, two conflicting writes can each succeed on different replicas.
  • Failures tolerated are N − R for reads and N − W for writes. The headline is the smaller, since you need both.
  • In the diagram, the write goes to the first W replicas and the read to the last R: the smallest possible overlap. The shared replica carries the new value to the reader.
  • Latency waits for the R-th fastest reply out of N, not the slowest. The 99th percentile grows faster than the mean.

Questions

What does R + W > N guarantee?

That a read set and a write set must share at least one replica, so a read contacts a copy that acknowledged the latest write. It is the rule in the Dynamo paper and in Cassandra’s consistency levels.

Is a quorum read always up to date?

Not in every system. Overlap is necessary but not enough for linearizability. Sloppy quorums, failed partial writes and concurrent writes can still produce older or conflicting values, so stores add versioning, read repair or consensus.

Why would I choose R = 1?

To make reads fast and available. With R = 1 you need W = N for overlap, which means one down replica blocks writes. Many systems accept stale reads instead and keep both quorums small.

What is a QUORUM in Cassandra?

A majority of the replicas, floor(RF / 2) + 1. With RF = 3 that is 2. Reading and writing at QUORUM gives R + W > N, so the sets overlap.

Does a bigger N always help?

It tolerates more failures and spreads reads, but each write sends more copies and a majority gets larger. Odd values waste less: with majority quorums N = 4 needs 3 replicas and tolerates 1 failure, like N = 3, while N = 5 tolerates 2.

Learn it properly

Sources

Last updated

More tools

All tools

Your first senior-level
lesson is free.

Choose a course, open a free lesson, and explore an idea you’ve wanted to understand.