Is leader election the same problem as consensus?
They're related but distinct. Leader election answers one question: which single node is currently in charge. Consensus (what Raft and Paxos solve) answers a broader question: how do multiple nodes agree on a sequence of values or operations, safely, even under failures — and modern consensus protocols happen to include leader election as one piece of a larger mechanism. You can solve leader election on its own, which is what the Bully and Ring algorithms do, without solving general consensus.
Answered in
Before Raft: How the Bully and Ring Algorithms Elect a LeaderLeader election is a distinct problem from consensus. The Bully and Ring algorithms solve 'who's in charge' with nothing but timeouts and node IDs.
Read the full analysisOther questions this article answers
More system design & architecture questions
- How much spare capacity should a gateway keep?
- Why are bounded queues important for availability?
- Should a load balancer always move requests away from an unhealthy server?
- Can a circuit breaker prevent every cascading failure?
- Why does pagination improve API performance beyond just 'smaller responses'?
- Why is asynchronous logging faster than writing logs synchronously?
- When does caching actually help API performance, and when doesn't it?
- Why does payload compression trade CPU time for network time, and when is that worth it?
Every answer on Crashtech is written by the editor of the article it comes from — never auto-summarised. Browse all answers or the System Design & Architecture beat.