Why nodes need agreement under failures
coreintermediateWhen the same data or decision is replicated across several nodes, those nodes must all end up agreeing on the same sequence of operations — otherwise they silently drift into different states while each one still believes it is correct. This is easy on a single machine (there is only one copy of the truth) and hard across a network, because nodes can crash, restart, or simply fail to hear a message in time, and the rest of the system cannot always tell the difference between "that node is dead" and "that node is just slow." Consensus is the general problem of getting a group of nodes to agree on one value or one ordered log of operations despite some of them crashing or messages being lost or delayed.
Think of it as
Picture three people scattered across a building, each with a walkie-talkie, trying to agree on a single meeting time by shouting messages that sometimes get lost in the static. If one person goes quiet, the other two cannot tell whether they stepped away for a minute or left the building for good — but the group still has to settle on one time everyone will show up to, without ever calling and asking the missing person directly. That is the consensus problem: agree on one answer, using only unreliable messages, without being sure who is still listening.
What we're doing: Show what goes wrong without any agreement mechanism when a leader node becomes unreachable.
- 3
- Node A cannot distinguish "network partition" from "everyone else crashed" — it has no way to know it lost quorum.
- 7
- B and C proceed without A because they can still reach each other — this is the moment consensus rules (majority quorum) need to apply.
- 11
- Two leaders accepting writes simultaneously is exactly the failure a consensus protocol is designed to make impossible.
Why this works: This is the concrete failure mode — split brain — that motivates the entire topic: without a formal agreement protocol, a distributed system has no principled way to decide which node's decisions are authoritative during a partition.
Assuming "the leader will notice it lost connectivity and step down"
Wrong
Better
What you see: Two nodes both serve writes as if they were the sole leader after a network blip, and reconciling the two histories afterward requires manual intervention or silently drops data.
Why: A node on the wrong side of a partition has no direct way to observe that it is cut off — it can only infer this from silence, and silence is indistinguishable from "everyone is just slow." Only an explicit majority/quorum rule, not self-awareness, can prevent both sides from acting as leader.
- Node A → Node B: network partition (A isolated from B and C)
- Node A → Node A: still accepts writes (believes it is still leader)
- Node B → Node C: elect B (no quorum rule) (B and C proceed without A)
- Node B → Node B: also accepts writes (split brain — no way to tell whose writes win)
Remember: Consensus is the general problem of getting nodes to agree on one value or ordered log despite crashes and lost/delayed messages — the danger without it is split brain, where two nodes both believe they are authoritative at once.
See also: raft paxos purpose · consensus in practice

