Consensus is the problem of getting distributed nodes to agree on a value or decision despite failures or network partitions. It matters when no single node controls the whole database: a transaction that commits across nodes requires them to agree on what happened. section 6.6 section 6.5
Two writes, one decision
Suppose one node receives a request to set foo=42 while another receives a request to set foo=200. Without agreement, the nodes could return different values. Consensus is how they settle on one outcome rather than each treating its own write as authoritative. section 6.6
A consensus algorithm must provide three properties:
- Termination: the decision process does not remain stuck forever. section 6.6
- Integrity: a node does not change its decision after reaching it. section 6.6
- Agreement: nodes reach the same outcome. section 6.6
Consensus supports strong consistency, leader election, reliable replication, and recovery after failures. Its guarantees involve both safety—not deciding conflicting values—and liveness—eventually reaching a decision. Network partitions make these promises costly: consistency and availability cannot both be guaranteed during a partition. Paxos and Raft are two named consensus algorithms. section 6.6 section 6.15




