Try
↑ ↓ move↵ openesc close

Interview prep / Quorums

Senior · Quorums · System design interview question

You run a five-replica store. Pick R and W for a shopping cart, for a write-heavy event log, and for a configuration store. Defend the choices.

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

A strong answer

Each workload fixes a different priority. For a shopping cart, availability for writes matters, since a refused add-to-cart loses a sale, and a stale read is tolerable if carts can be merged. Choose a small W, perhaps 1 or 2, a moderate R, and a merge strategy for concurrent versions. The accepted cost is that a read can miss a very recent add.

For a write-heavy event log, writes dominate, so W should be small, such as 1 or 2, with R larger or reads done in the background where staleness is harmless. If readers need completeness, they can read with a higher R when they need it.

For a configuration store, a stale read can cause a wrong action, and writes are rare. Choose R and W with R plus W above N, such as 3 and 3, and accept slower writes. If it must be fully consistent, say a quorum is not enough and move to consensus.

In many systems R and W can be set per request, so one store can serve all three. The final numbers also depend on latency tails, failure rates and whether sloppy quorums are on.

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