On this page
Kafka Improvement Proposal
KIP-500: KRaft, Kafka without ZooKeeper
KIP-500 replaced ZooKeeper with KRaft, a quorum of Kafka controllers that store the cluster metadata in a Kafka log of their own. One system to run instead of two, faster controller failover, and room for millions of partitions. KRaft has been production-ready since Kafka 3.3, and Kafka 4.0 removed ZooKeeper entirely.
- Proposal
- KIP-500, Replace ZooKeeper with a Self-Managed Metadata Quorum
- Status
- Shipped KRaft production-ready since Kafka 3.3; ZooKeeper removed in Kafka 4.0.
- Area
- Cluster and operations
- Proposal page
- KIP-500 on the Apache Kafka wiki
Why it was needed
For its first decade Kafka kept topics, partitions, leaders and configs in ZooKeeper, a separate distributed system with its own deployment, security and monitoring. One broker acted as controller and had to load the whole state from ZooKeeper when it took over, which on large clusters took minutes; partition counts were limited by how fast that worked. Two systems also meant two places for metadata to disagree.
What it changes
A small set of controller nodes, usually three or five, form a Raft quorum (designed in KIP-595). The active controller writes every metadata change as a record to the __cluster_metadata log, the other controllers replicate it, and brokers follow the log too, so every node has the metadata in memory already. A controller failover is a Raft election among nodes that are already up to date, not a reload from an external store.
How to use it
- New clusters on Kafka 4.0 or newer are KRaft only: set process.roles and controller.quorum.bootstrap.servers (or controller.quorum.voters).
- ZooKeeper clusters must be migrated to KRaft on a 3.x release, at the latest 3.9, before upgrading to 4.0.
Where it stands
Accepted in 2019. KRaft became production-ready for new clusters in Kafka 3.3, ZooKeeper mode was deprecated in 3.5, Kafka 3.9 was the last release able to migrate a ZooKeeper cluster, and Kafka 4.0 removed ZooKeeper mode completely in March 2025. Every current Apache Kafka cluster runs on KRaft.
What comes next
The KIP-500 programme is finished. Work continues on KRaft itself: dynamic controller membership (KIP-853, Kafka 3.9) lets you add or remove controllers without downtime, Kafka 4.2 let new controllers join the quorum automatically, and Kafka 4.4 added unregistering controllers (KIP-1312).
See it in the simulator
- Kafka ZooKeeper vs KRaft: what freezes leader elections (ZooKeeper vs KRaft: the same cluster, two control planes) Step 6: Ensemble node z2 killed → ensemble majority lost → NO controller Open at this step: Kafka ZooKeeper vs KRaft: what freezes leader elections
- Kafka KRaft quorum: losing a majority of controllers (KRaft quorum) Step 5: Second voter c1 killed - only c0 left, no majority, quorum lost Open at this step: Kafka KRaft quorum: losing a majority of controllers
- Kafka KRaft quorum: losing a majority of controllers (KRaft quorum) Step 2: Standby c2 killed - 2 of 3 voters, majority holds, c0 active Open at this step: Kafka KRaft quorum: losing a majority of controllers
Sources
- KIP-500: Replace ZooKeeper with a Self-Managed Metadata Quorum
- Apache Kafka 4.0.0 release announcement
- KIP-853: KRaft Controller Membership Changes