Leader election and leases
A job runs every night to charge subscriptions. You run three copies of it for safety. One night, all three think they're in charge, and every customer is charged three times. Some work must be done by exactly one machine at a time.
In this lesson you'll learn to
- Explain why systems elect a leader, and what goes wrong with zero or two leaders.
- Describe how a lease with a time limit lets a leader be replaced when it fails.
- Use term or epoch numbers so that an old leader's actions are ignored.
- Use a coordination service such as etcd, ZooKeeper or a Kubernetes Lease instead of building election yourself.
Create a free account to open this lesson
It's free. You'll get every free lesson, quizzes that save your progress, daily flashcards and streaks.