LearnastraTHE DESIGN COURSE

Understand the building blocks / CHAPTER 19

Read and write quorums

Use set intersection correctly while recognizing that arithmetic alone does not establish linearizability.

Advanced1h of deliberate study10 questions

Builds on CAP: consistency and availability during partitions, Redundancy and replication.

By the end, you can
  • Calculate read/write and write/write intersection conditions.
  • Explain what intersection proves and what it does not.
  • Reason about fixed membership, versions, failures, and concurrent writes.

01Count the participants, then ask what they promise

Five machines A, B, C, D, and E keep copies of one value. A client write waits until three machines have safely saved the change. A read asks three machines for their versions. Those required participant groups are quorums.

Define the counts before using the equations:

  • N is the number of replicas in the fixed group: five here.
  • W is the number of required write acknowledgments: three here.
  • R is the number of responses the read collects: three here.
  • Say what each acknowledgment proves. Receipt in memory is not the same promise as a saved durable log entry.

Work a particular overlap:

  1. The write saves version 8 at A, B, and C.
  2. A read collects responses from A, D, and E.
  3. Both groups contain A. That shared participant can tell the read about version 8.
  4. The two groups contain six places in total, but only five different machines exist. At least one machine must occur in both groups.

The minimum overlap is R + W − N when that number is positive. Here 3 + 3 − 5 = 1. This proves a fact about shared participants. It does not yet define which returned value the read selects or how concurrent writes are resolved.

02Use the equations without claiming too much

Use the count rules for exactly what they prove:

  • R + W > N makes every allowed read group intersect every successful-write group within the same fixed replica set.
  • W + W > N makes any two write-acknowledgment groups intersect. It does not make their writes automatically ordered or give one writer exclusive permission.
  • If R + W <= N, disjoint groups are possible. With five replicas and two participants per operation, write A/B and read D/E share nobody.

Now inspect values, not just counts:

  1. A successful write saved version 8 at A/B/C.
  2. A read of A/D/E receives versions 8, 7, and 7.
  3. Returning the fastest response, perhaps 7, ignores the relevant newer value available within the collected group.

Even selecting the highest version requires more protocol rules. Consider an incomplete write:

  1. An attempted version 9 reaches only A, then the client times out without success.
  2. A read of A/D/E sees 9 at A and returns 9.
  3. A later read of B/C/E sees only 8 and returns 8.
  4. With no intervening update, the reads have moved backward. Both collected three responses; overlap alone did not prevent this.

A complete protocol must handle partially stored values and simultaneous writers. Some protocols make a reader copy its selected value to enough replicas before returning, called read write-back. In this five-replica example, a reader could save its selected version 9 to three replicas before completing. Any later three-replica read then shares at least one of those saved copies. Version selection, simultaneous writers and incomplete operations still need the full protocol’s rules. Others use a full agreement protocol to order accepted changes. These are algorithms with additional rules, not consequences of the equation alone.

A timestamp-based last-write-wins rule also needs care. Clock disagreement can make an older real-world edit appear newer, ties need a rule, and a discarded edit does not reappear merely because replicas later agree.

03Keep membership, failure, and repair explicit

The overlap proof assumes reads and writes choose participants from the same fixed replica set. Check that assumption against the actual operation.

A sloppy quorum can use temporary substitutes when normal owners are unavailable:

  1. The intended replicas are A through E.
  2. A write actually saves on A and substitutes X and Y.
  3. A later read asks B, C, and D.
  4. That read shares nobody with the actual write, despite the intended count of five owners. Calculating against the intended list cannot prove this operation’s overlap.

Changing the owner list must transfer accepted values and prevent the old and new groups from accepting unrelated histories. Otherwise a read using new owners can miss a write completed under the old list even when each list’s own counts satisfy the equation. Use the store’s membership-change protocol rather than changing the list independently at each client.

Test failure counts and physical placement separately:

  • With five replicas and W=3, three communicating eligible replicas can meet the count while two are unavailable, provided every other protocol rule holds.
  • A three-versus-two network split can let the larger side proceed while the smaller cannot. This is useful partial service, not completion at every healthy node.
  • Three acknowledgments in one zone do not protect against destruction of that zone.
  • Larger required groups can add waiting and prevent progress in more failure cases. Smaller groups are safe only if the complete protocol still provides the required result.

In an interview, write actual participant names beside their returned versions. Explain what they saved, how the read chooses a result, what happens to incomplete writes, and how membership changes. Quorum intersection supplies information to a correct protocol; it is not a substitute for that protocol or for permission checks.

Two sets overlap; their values still need a protocol

Two sets overlap; their values still need a protocolWrite down A/B/C as the successful write participants. Collect the read responses from A/D/E and attach versions 8, 7, and 7. Identify shared participant A. Explain how the protocol chooses and preserves a result, including partially completed writes. Numbered arrows correspond to the connection key below. All connections are directional.Successful writeW=3 within A–ERead operationR=3 within the sameA–EWrite set A, B, CRetain version 8Read set A, D, EReturns 8,7,7Intersection: AAt least one sharedparticipantRead/writeprotocolChoose versions;handle incompletewrites12345Two sets overlap; their values still need a protocolWrite down A/B/C as the successful write participants. Collect the read responses from A/D/E and attach versions 8, 7, and 7. Identify shared participant A. Explain how the protocol chooses and preserves a result, including partially completed writes. Numbered arrows correspond to the connection key below. All connections are directional.Successful writeW=3 within A–ERead operationR=3 within the sameA–EWrite set A, B, CRetain version 8Read set A, D, EReturns 8,7,7Intersection: AAt least one sharedparticipantRead/writeprotocolChoose versions;handle incompletewrites12345Two sets overlap; their values still need a protocolWrite down A/B/C as the successful write participants. Collect the read responses from A/D/E and attach versions 8, 7, and 7. Identify shared participant A. Explain how the protocol chooses and preserves a result, including partially completed writes. Numbered arrows correspond to the connection key below. All connections are directional.Successful writeW=3 within A–ERead operationR=3 within the sameA–EWrite set A, B, CRetain version 8Read set A, D, EReturns 8,7,7Intersection: AAt least one sharedparticipantRead/writeprotocolChoose versions;handle incompletewrites12345

Follow the numbered arrows

  1. Successful write → Write set A, B, Crequires durable acknowledgments
  2. Read operation → Read set A, D, Ecollects stated responses
  3. Write set A, B, C → Intersection: Acontains A
  4. Read set A, D, E → Intersection: Aalso contains A
  5. Intersection: A → Read/write protocolinformation, not complete proof
The write group A/B/C and read group A/D/E share A. A supplies version 8 while D and E supply 7. The read must interpret those responses through the complete version and incomplete-write rules; overlap by itself is only the shared-participant fact.
Trace the diagram in words
  1. Write down A/B/C as the successful write participants.
  2. Collect the read responses from A/D/E and attach versions 8, 7, and 7.
  3. Identify shared participant A.
  4. Explain how the protocol chooses and preserves a result, including partially completed writes.

DRAW. CALCULATE. EXPLAIN.

Prove the set fact and limit the claim

20 minutes · guided practice

Use four fixed replicas A through D. A write needs three saved acknowledgments; a read collects two responses.

  1. Choose write and read groups with the smallest possible overlap.
  2. Give them versions showing why the fastest read response may be wrong.
  3. Name two rules that are still needed beyond the overlap calculation.
Your self-check
Compare the worked solution
  1. Write to A/B/C and read C/D. Only C is shared, matching 3 + 2 − 4 = 1.
  2. Suppose the completed write saved version 8 at C while D still has 7. Returning D’s faster response ignores the newer value available from C.
  3. Define how the read compares and selects versions, including simultaneous writes.
  4. Define what happens to a value saved at some replicas by an attempted write that timed out. One read must not expose that value and a later read move backward if the contract requires linearizability.
  5. Also specify any required read write-back, repair, and membership-transition rules. The count proves shared participation, not the entire read/write algorithm.

The checkboxes record your own assessment. The worked solution gives you a way to check the reasoning.

RETRIEVE BEFORE YOU REVEAL

Keep the important ideas.

Say the answer aloud, then turn the card over.

CARD 01What does R+W>N prove?
  1. Use one fixed set of N replicas.
  2. Collect W write acknowledgments and R read responses.
  3. If R+W>N, every read group shares at least one participant with every successful-write group.

The read still needs rules for interpreting versions and incomplete writes.

CARD 02Which rules are still needed after proving quorum overlap?
  • Define what each acknowledgment saved.
  • Define which participants count.
  • Handle simultaneous and partially completed writes.
  • Specify how reads choose and, if required, copy a value back.

Shared membership alone does not implement a current-value guarantee.

CARD 03Why is sloppy quorum different?
  1. A sloppy write may save on substitute machines outside the normal owner set.
  2. A later read of normal owners may miss those actual participants.
  3. Check the actual sets and supported recovery rules.

The intended replica count alone does not prove overlap.

Practise this topic in the revision deck ↗

CHECK THE REASONING

Can you explain the choice?

Answer every question, then finish for an immediate score and an explanation for each answer. Aim for 80%, then revisit any gaps.

1 / 10N=5, W=3, R=3. What is the minimum guaranteed read/write overlap in fixed membership?
2 / 10N=5, W=2, R=2. Which sets demonstrate the missing guarantee?
3 / 10A read obtains versions 8,7,7 after a successful version 8 write. What is wrong with returning the first 7?
4 / 10A write leaves a new version on some replicas but never returns success. Why must the protocol address it?
5 / 10What does W+W>N establish within one fixed replica set?
6 / 10A sloppy quorum writes to substitutes outside the usual owners. What must be checked?
7 / 10Five replicas split into groups of 3 and 2; W=3. Which group can meet the count if all other rules hold?
8 / 10What must a durable write acknowledgment specify?
9 / 10Why can wall-clock last-write-wins require care?
10 / 10Which conclusion is justified by a quorum diagram alone?
0 of 10 answered

CLOSE THE LOOP

Explain it without the page.

Summarise the mechanism, one trade-off, and one failure mode. Then mark this chapter complete.

Go to the source