Try
↑ ↓ move↵ openesc close

Interview prep / Quorums

Mid · Quorums · System design interview question

How does the choice of R and W affect latency, and why does one slow replica matter more as the quorum grows?

Sketch your own answer first, then compare it with the one below.

A strong answer

The coordinator sends the request to every replica and waits for the first k replies, with k being R or W. The latency of the operation is the arrival time of the k-th fastest reply. Raising k moves you further into the tail of the reply times.

If one replica is slow, a small quorum simply ignores it, because k other replicas answer first. Once k exceeds the number of fast replicas, the operation must wait for a slow one, so latency jumps to that replica's. With k equal to N every operation is as slow as the slowest replica, and the chance that at least one replica is slow on a given request grows with N.

The trade can be tilted to the workload. With R=1 reads are fast, while W=N makes every write pay for the slowest replica. Sending a second request after a short delay, a hedged request, also trims the tail.

Sources

Learn it by running it

The quorums lesson explains the mechanism behind this question, and its lab lets you change the parameters and watch the effect.

Your progress is saved in this browser. Sign in to keep it on every device. Privacy · Terms