1.Why nodes need agreement under failures
When 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.
Key features
- The core requirement is agreement on one value or one ordered sequence of operations, not just "everyone eventually has similar-looking data".
- Failures come in two flavors that look identical from the outside: a crashed node and a slow/network-partitioned node — this is why timeouts, not certainty, drive most real decisions.
- Without consensus, two nodes can each believe they are authoritative at the same time and accept conflicting writes — a split-brain scenario.
- A system that just lets any node accept writes independently trades consensus for availability, and must resolve conflicting histories later (or accept inconsistency) instead of preventing them up front.
- Consensus is provably impossible to guarantee in bounded time on a fully asynchronous network with even one faulty node (the FLP impossibility result) — real systems sidestep this with timeouts and randomization rather than a perfect guarantee.
- 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)
Signature
agreement on ONE value/order, despite crashes + lost messages
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.