Kafka Replication & Leader Election
6 min read.
Production Kafka fault tolerance: replicate a partition across brokers, commit with acks=all, and watch the controller elect a new leader from the ISR when a broker crashes.
Think of it this way: A replicated partition is like a document with one author (the leader) and proofreaders (followers) keeping live copies. If the author quits, a proofreader who has every page so far takes over — nothing already published is lost.
Broker 1
LeaderBroker 2
FollowerBroker 3
Followercommitted up to offset none, in sync 3 of 3
One partition on three brokers. Broker 1 is the leader. Amber records are not committed yet; green ones are.
Check your understanding
Answer from memory before you scroll back up. Pulling an idea out of your head is what makes it stay there.
A write with acks=all
Order what happens between send and acknowledgement.
Tap a piece, then tap where it goes — or drag it. Tap the tray to take one back.
- 1Drop a step here
- 2Drop a step here
- 3Drop a step here
- 4Drop a step here
- 5Drop a step here
Quiz
23 questionsUnder acks=all, when is a produced record considered committed?
Done with this lesson?
Sign in free to keep your progress, streak and quiz scores.