31. How does KRaft replace ZooKeeper in Kafka’s control plane?
Describe the responsibilities for cluster metadata and coordination under the two arrangements.
KRaft replaces ZooKeeper by moving Kafka’s cluster metadata and coordination into a Raft-based controller quorum. The quorum maintains a replicated metadata log and elects one active controller, while Kafka brokers continue handling produce and consume traffic.
ZooKeeper and KRaft solve Kafka’s control-plane problem in different places. In the ZooKeeper-era design, Kafka relies on an external ZooKeeper ensemble for cluster metadata, controller election, and coordination. With KRaft, those responsibilities move into Kafka itself. Dedicated Kafka controllers form a Raft-based metadata quorum, maintain a replicated metadata log, and elect one active controller while the others remain hot standbys. Kafka brokers remain the data plane: they continue serving produce and consume traffic and receive metadata and control updates from the active controller.
- Do you want the comparison focused only on metadata and controller coordination, or should I also discuss the operational impact of removing ZooKeeper?
- Should I explain what happens when the active KRaft controller fails?
- Do you want me to contrast the controller quorum explicitly with the Kafka broker data plane?
Start by separating the control plane from the data plane. Kafka brokers handle client data requests such as producing and consuming records. The control plane manages cluster metadata and coordinates changes to that metadata.
In the ZooKeeper-era arrangement, Kafka depends on an external ZooKeeper ensemble. ZooKeeper stores cluster metadata and participates in coordination used for controller election and other cluster-management activities. One Kafka broker becomes the Kafka controller, while the brokers continue handling client data traffic.
KRaft removes the ZooKeeper dependency by moving these control-plane responsibilities into Kafka. Specific Kafka servers are selected as controllers and form the metadata quorum. The controllers use Raft to replicate Kafka’s metadata log. One controller is active, and the other controllers are hot standbys that follow the replicated metadata state.
The active controller handles metadata-related control-plane work and communicates metadata and control updates to the brokers. The brokers remain responsible for the data plane and continue serving produce and consume requests. They do not become members of the metadata quorum merely because they are Kafka brokers.
If the active KRaft controller fails, another sufficiently up-to-date controller can become active as long as the metadata quorum still has the majority required to make progress. The replicated metadata log allows the new active controller to continue from the quorum’s committed control-plane state.
The key architectural change is therefore where Kafka’s coordination state lives. ZooKeeper provided an external metadata and coordination service. KRaft places that responsibility inside Kafka through a controller quorum and replicated metadata log. This removes a separate ZooKeeper system from the architecture, but it does not remove distributed consensus or the need for a healthy control-plane quorum.
- Separate Kafka’s control plane from its broker data plane.
- Describe the ZooKeeper-era arrangement: external metadata storage, controller election, and cluster coordination.
- Explain that one broker acts as the Kafka controller in the ZooKeeper-era architecture while brokers continue serving client data traffic.
- Replace ZooKeeper with the KRaft controller quorum.
- Describe the replicated metadata log, one active controller, and hot-standby controller followers.
- Explain that the active controller sends metadata and control updates to brokers while brokers continue serving produce and consume traffic.
- State the availability trade-off: ZooKeeper is removed, but the KRaft metadata quorum must retain a majority to make control-plane progress.
KRaft does not eliminate the work of distributed coordination; it moves that work into Kafka. Controller nodes use CPU, memory, storage, and network capacity to replicate the metadata log and participate in Raft consensus. Operationally, there is one fewer separate distributed system because ZooKeeper is no longer required. The main availability cost is that the controller quorum must keep a majority available to elect or maintain an active controller and commit metadata changes. Kafka broker data traffic remains separate from this control-plane work.
This question checks whether a candidate understands Kafka’s control plane versus its data plane, the responsibilities ZooKeeper historically handled, and how KRaft replaces that external dependency with Kafka’s own replicated controller quorum.
A common mistake is saying KRaft removes coordination entirely. It does not; it replaces ZooKeeper with Kafka’s own Raft-based metadata quorum. Another mistake is treating ordinary Kafka brokers as controller-quorum followers. The selected controller nodes participate in the metadata quorum, while brokers remain responsible for client data traffic. Candidates also confuse the active KRaft controller with partition leaders for user records. Finally, ZooKeeper should not be described as handling client produce or consume traffic; Kafka brokers handle that data-plane work.
Explain it as a control-plane replacement: ZooKeeper was the external metadata and coordination service; KRaft moves those responsibilities into Kafka through a Raft-based controller quorum and replicated metadata log. Then state clearly that brokers still handle client data traffic.










