CONCEPT Cited by 1 source
Consensus algorithm¶
A consensus algorithm allows a set of machines communicating over a network to agree on the same sequence of values (e.g., key-value store operations) as long as a majority remains alive and able to communicate.
Definition¶
A consensus algorithm provides two guarantees:
- Safety — if any two replicas decide on the value for a slot, those values are the same (no two up-to-date machines ever disagree about the world)
- Liveness — the system eventually makes progress (a value is eventually decided) as long as a majority of replicas can communicate
Fault tolerance model¶
Standard consensus algorithms tolerate f faults in a system of 2f+1 machines (crash-fault tolerance). They do not handle Byzantine faults (actively malicious actors).
Leader-based vs leaderless¶
- Leader-based (e.g., Raft, Multi-Paxos): a single authoritative leader drives all writes; followers replicate. Simple to understand but creates a single point of temporary failure.
- Leaderless (e.g., QuePaxa): any replica can drive consensus. A leader may exist for efficiency but is not required for progress. See concepts/leaderless-consensus.
The cost of consensus¶
All consensus algorithms require communication round-trips between the proposer and a majority of replicas. Latency is proportional to the network distance between those replicas — there is no getting around this fundamental cost.
Seen in¶
- sources/2026-07-08-cloudflare-introducing-meerkat-global-consensus — Cloudflare's explanation of why they need consensus and the properties it provides
Related¶
- concepts/linearizability — the consistency level consensus enables
- concepts/leaderless-consensus — variant without a required leader
- concepts/replicated-log — common abstraction built on consensus
- concepts/leader-election — often implemented via consensus
- systems/meerkat — Cloudflare's consensus service
- systems/quepaxa — leaderless consensus algorithm
- systems/raft — widely-deployed leader-based consensus