AdvancedInternals Deep Dive
What is the Kafka Raft (KRaft) consensus algorithm and how does it differ from ZooKeeper's ZAB?
Reference answer
KRaft uses Raft consensus where voters elect a leader, the leader writes all entries, and entries are committed when a majority acknowledges them. The controller quorum uses this to manage cluster metadata. ZooKeeper uses ZAB (ZooKeeper Atomic Broadcast) which is Raft-like but has different epoch/view semantics. Key differences: KRaft is embedded in Kafka (no external dependency), KRaft stores metadata in a Kafka log (auditable, replayable), KRaft controller failover is seconds vs ZooKeeper's ~30s, KRaft scales to millions of partitions vs ~200k for ZooKeeper. Both require majority quorum.
Expected key concepts: Raft, majority quorum, leader, ZAB, ZooKeeper Atomic Broadcast, embedded, metadata log, failover, seconds, 200k, millions, epoch