Majority Quorum

The Majority Quorum pattern is the mathematical foundation for strong consistency and high availability in distributed clusters. It ensures that a system can tolerate node failures without losing data or allowing conflicting updates, provided a majority of the cluster remains operational.

1. The Quorum Inequality

A distributed system consists of Ntotal nodes. To maintain strong consistency (Linearizability), the number of nodes required for a successful write (W) and the number of nodes polled for a read (R) must satisfy the following inequality:

R + W > N

The Pigeonhole Principle

The logic relies on the Pigeonhole Principle: if the sets of nodes used for reading and writing overlap by at least one node, that overlapping node acts as the "witness" that carries the most recent state.

2. Mathematical Proof

We can prove thatR + W > Nguarantees that every read will see the latest write.

  1. LetSbe the set of allNnodes.
  2. LetV_wbe the set ofWnodes that acknowledge the latest write.
  3. LetV_rbe the set ofRnodes polled for a read.
  4. The number of nodes that did not participate in the write isN - W.
  5. If the read setV_rwere to contain no nodes fromV_w, thenV_rmust be a subset of the non-write set:V_r \subseteq (S \setminus V_w).
  6. This is only possible if the size of the read set is less than or equal to the size of the non-write set:R \le N - W.
  7. Rearranging givesR + W \le N.
  8. By contradiction, if R + W > N, there must be at least one nodenthat is in both sets:n \in (V_w \cap V_r).

3. Common Quorum Configurations

The selection ofRandWvalues allows architects to tune the system for specific workload profiles:

StrategyConfigurationStrengthWeakness
Strict MajorityW = \lfloor N/2 \rfloor + 1
R = \lfloor N/2 \rfloor + 1
Balanced. Tolerate\approx 50\%failures.High coordination overhead.
Write-HeavyW = N
R = 1
Extremely fast reads (1 node).A single node failure blocks all writes.
Read-HeavyW = 1
R = N
Extremely fast writes (1 node).A single node failure blocks all reads.

4. Fault Tolerance Calculation

For a cluster of sizeNusing strict majority (W = R = \lfloor N/2 \rfloor + 1), the number of nodes that can fail (f) while maintaining availability is:

f = \lfloor \frac{N-1}{2} \rfloor

| Cluster Size (N) | Max Failures (f) | Majority Required || :--- | :--- | :--- | | 3 | 1 | 2 | | 5 | 2 | 3 | | 7 | 3 | 4 |

Architectural Note: Distributed clusters almost always use odd numbers of nodes. Increasing from 3 to 4 nodes does not increase the fault tolerance (both can only survive 1 failure), but it increases the number of nodes that must be coordinated for a majority (from 2 to 3), actually decreasing performance.

5. Usage in Industry

See Also