Skip to main content
KBY Technologies Logo
cd ../lexicon
sys/docs/lexicon/flexible-paxos.md
Lexicon Entry

Flexible Paxos

Flexible Paxos is a generalization of the classic Paxos consensus algorithm that proves quorum intersection is only required between Phase 1 (leader election) and Phase 2 (replication) quorums, not among all Phase 2 quorums themselves. This relaxation allows quorum sizes to be tuned independently per phase, enabling smaller, more efficient write quorums without sacrificing safety.

Practical example

A 7-region metadata store uses a 5-of-7 quorum for leader election (Phase 1) but only requires 3-of-7 acknowledgments for steady-state log replication (Phase 2), cutting median write latency in half while still guaranteeing safety because every possible 5-node election quorum intersects every possible 3-node replication quorum.

Classical Paxos safety proofs rely on the invariant that any two quorums (of acceptors) must intersect, which is traditionally satisfied by requiring all quorums to be strict majorities. Flexible Paxos (Howard, Schwarzkopf, Madhavapeddy, Crowcroft, 2016) revisits the safety argument and shows the actual requirement is weaker: every Phase 1 quorum must intersect every Phase 2 quorum, but two Phase 2 quorums need not intersect each other. This is because Phase 1’s role is solely to discover the highest-numbered accepted value before a new leader proposes; if that guarantee holds, Phase 2 can use disjoint quorum sets across different proposal rounds without introducing conflicting decisions.

The practical consequence is that system designers can decouple the quorum size used for leader election from the quorum size used for steady-state replication. A common configuration sets Phase 2 (replication) quorums to a minority-sized set (e.g., 2 of 5 nodes) while compensating with a larger Phase 1 quorum (e.g., 4 of 5) during leadership changes, which are comparatively rare. This trades increased cost during leader failover for reduced latency and fault tolerance overhead during normal-case writes — the operation executed far more frequently in production systems.

  • Grid Quorums / WPaxos: Flexible Paxos underpins geo-distributed consensus protocols like WPaxos, which partition the acceptor set into groups and route object ownership dynamically, using Flexible Paxos quorum rules to reduce cross-region round trips for objects with local access locality.
  • Quorum asymmetry hazards: Because Phase 2 quorums are no longer guaranteed to intersect, systems must ensure that at most one leader is active per epoch (via fencing/ballot numbers) — the safety net shifts entirely onto correct epoch/ballot monotonicity rather than quorum overlap during replication.
  • Reconfiguration complexity: Any online quorum resizing (adding/removing acceptors) must still preserve the Phase1/Phase2 intersection invariant across the transition, which is significantly harder to reason about than uniform-majority Paxos and is a common source of subtle correctness bugs in custom implementations.

Most production consensus systems (etcd/Raft, Consul, ZooKeeper’s ZAB) still use uniform majority quorums because the engineering complexity of asymmetric quorums is rarely justified outside of geo-replicated, latency-sensitive, or extremely large acceptor-set deployments. Flexible Paxos is primarily relevant when designing custom consensus layers for wide-area storage systems, multi-region metadata stores, or research into leaderless/multi-leader Paxos variants, where the cost asymmetry between leader-election and steady-state replication becomes economically significant.