Paths Subjects Questions Quizzes Pricing Search
Intermediate Open Free

Quorum Reads and Writes

A leaderless key-value store keeps every key on N = 5 replicas. The operations team is choosing default write (W) and read (R) quorum sizes. They are considering W = 3, R = 3, W = 1, R = 5, and W = 2, R = 2.

  1. For each configuration, state whether a read is guaranteed to observe the most recent acknowledged write, and explain the rule you used.
  2. Walk through a concrete example with W = 2, R = 2: replicas A–E, a write acknowledged by two of them, and a read that misses it.
  3. The system enables sloppy quorums with hinted handoff during outages. Which of your answers to part 1 changes, and why?
Solution

1. Which configurations give read-latest guarantees

The rule is W + R > N: the set of replicas that acknowledged the write and the set of replicas that answered the read must overlap in at least one node, so at least one response carries the newest version (which the client selects by version number or timestamp).

  • W = 3, R = 3: 3 + 3 = 6 > 5 — guaranteed overlap. Balanced latency for reads and writes; tolerates 2 replicas down for both operations.
  • W = 1, R = 5: 1 + 5 = 6 > 5 — guaranteed overlap, but reads need every replica to respond, so a single unavailable replica blocks all reads. Fast writes, fragile reads.
  • W = 2, R = 2: 2 + 2 = 4 \le 5no guarantee. Reads can be stale.

2. Concrete stale read with W = 2, R = 2

Replicas A, B, C, D, E hold x = 1. A client writes x = 2; A and B acknowledge and the write is reported successful (W = 2). Replication to C, D and E is still in flight. A second client reads with R = 2 and happens to get responses from D and E first — both still hold x = 1. The read returns x = 1 even though x = 2 was acknowledged. Nothing in the protocol prevented the read set {D, E} from being disjoint from the write set {A, B}, which is exactly what W + R \le N permits.

3. Effect of sloppy quorums

With sloppy quorums, when some of the five home replicas are unreachable, the write may be accepted on other nodes (say F and G) with a hint that the data belongs to A–E. The write counts as acknowledged, but none of the home replicas may have it until hinted handoff completes. A subsequent read of R = 3 from A–E can therefore miss the write even though W + R > N on paper. So the guarantee in part 1 for W = 3, R = 3 (and W = 1, R = 5) no longer holds during and shortly after the outage — the system chose availability (accept the write) over the read-latest guarantee. That is the trade-off to state in an interview: sloppy quorums keep the store writeable through partitions at the cost of temporarily weakening what the quorum condition promises.

Share this question

← Back to Database Replication & Sharding practice

We use cookies for product analytics to improve OmniAtlas. See our Privacy Policy.