Skip to content

Kafka in Docker - Prelude Part Two - ZooKeeper and KRaft

Published: at 03:31 PM

In the first article in this series, I covered consensus algorithms and their application to Kafka. This article continues along a similar trajectory albeit with more practical applications.

ZooKeeper

ZooKeeper was the original metadata and coordination layer for Kafka. If you encounter a mature Kafka deployment then it’s likely that they are still using ZooKeeper.

Why Choose ZooKeeper?

To summarize: ZooKeeper is still reliable, stable, and supported.

KRaft

KRaft (Kafka Raft) removes the ZooKeeper dependency by embedding Raft-based consensus directly into Kafka itself.

Why Choose KRaft?

To summarize: KRaft is modern, simplified, and the future of Kafka.

Choosing the Docker Image For Your Needs

There are a lot of Kafka Docker images floating around and it can be overwhelming to pick the right one for your needs. This is because certain images will lock you into using ZooKeeper or KRaft. So, if you need ZooKeeper but you choose an image that uses KRaft you’re gonna have a bad time.

ImageKRaftZooKeeperOpen Source?Best For
bitnami/kafka✅ Apache 2.0Most users, easy switch between modes
confluentinc/cp-kafka✅ (< 8.0)🚫 Mostly OSS, but requires Confluent license for full featuresFull Confluent Platform users
apache/kafka🚫✅ Apache 2.0Minimalist, official
wurstmeister/kafka✅ Apache 2.0Legacy tutorials only
landoop/fast-data-dev🚫 MixedQuick sandboxing, not prod-ready

From here we should be armed with enough knowledge to actually install Kafka in Docker. This will be the subject of the next article in this series.


Previous Post
The Language of Design
Next Post
Kafka in Docker - Prelude Part One - Consensus Algorithms