Kafka Topic Partitions in Practice
Explore how to manage Kafka topic partitions by learning to check partition counts, create topics with multiple partitions, and increase partitions in existing topics. Understand the impact of changing partitions on data ordering and why planning partitions upfront is critical for scalable stream processing.
Checking the number of partitions in a topic
How can we find out the number of partitions in a topic? Connect to the terminal below (the Kafka server will start running automatically). Then, create a topic like we did in previous lessons by running the following:
Now that we know about the existence of partitions, we can wonder how many partitions a topic created with this command have. The answer is usually 1, but it might be configured. Let’s verify this by running the following command:
In the output, we can see a few important properties of the topic, including PartitionCount, which is indeed 1! We used the same script that we used to create the topic (kafka-topics.sh), but instead of providing the --create ...