The consensus problem
Consensus requires a set of nodes to agree on a single value, with three properties:
- Agreement: all correct nodes decide the same value.
- Validity: the decided value was proposed by some node (no values from thin air).
- Termination: all correct nodes eventually decide.
Why is it hard? Because you cannot distinguish a crashed node from a very slow one. If you wait too long, you may sacrifice liveness (termination). If you decide too early, a "dead" node may come back with a conflicting proposal and violate agreement. Every consensus protocol is a careful negotiation of these two dangers.
Consensus underlies: atomic broadcast, replicated state machines, distributed transactions, leader election, and lock services. Get it wrong and your "reliable" database silently splits into two independent primaries.
