How does the Ring algorithm avoid the Bully algorithm's broadcast overhead?
Instead of every node messaging every higher-ID node, the Ring algorithm arranges nodes in a logical ring and passes an election message around it in one direction only. Each node adds its own ID (if higher than what it received) and forwards the message; when a node receives a message containing its own ID back, it knows it has the highest ID and declares itself leader, then circulates that result once more around the ring.
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.