Consistency & Consensus for System Design Interview (8): leader election
PREV | HOME | NEXT | System Design Resource List
Don’t forget to get your copy of Designing Data Intensive Applications, the single most important book to read for system design interview prep!
Check out ByteByteGo’s popular System Design Interview Course
Introduction
We have previously discussed single leader replication, where all writes are directed to a single leader and then applied in the same order to all the followers. Note that the writes applied to the leader must be delivered exactly once in exactly the same order to all the followers, much like a total order broadcast! So we can say that single leader replication is equivalent to a total order broadcast algorithm. There are two ways to elect a leader in case of single leader replication:
- Human Intervention: A node within a cluster can be configured as the leader. If the leader fails, a human operator is required to elect a new one. This form of single leader replication satisfies all the properties of a consensus algorithm except termination as a failure requires a human to come and designate a new leader.
- Auto Leader Election: Some systems allow for a new leader from among the followers to be elected in case the current one…