0
0
Kafkadevops~5 mins

Partition count strategy in Kafka - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a partition in Kafka?
A partition is a division of a Kafka topic that stores a subset of the messages. It allows Kafka to scale and distribute data across multiple brokers.
Click to reveal answer
beginner
Why is the number of partitions important in Kafka?
The number of partitions affects parallelism, throughput, and fault tolerance. More partitions allow more consumers to read in parallel but can increase complexity.
Click to reveal answer
intermediate
What happens if you increase the partition count after topic creation?
You can increase partitions, but existing data stays in old partitions. New partitions start empty. This can affect message ordering and consumer logic.
Click to reveal answer
beginner
How does Kafka assign messages to partitions by default?
Kafka uses a partitioner that assigns messages based on the message key's hash. If no key is provided, it uses round-robin to distribute messages evenly.
Click to reveal answer
intermediate
What is a good strategy to decide the number of partitions?
Consider expected throughput, number of consumers, and hardware limits. Start with enough partitions to allow parallelism but not too many to avoid overhead.
Click to reveal answer
What does increasing the number of partitions in a Kafka topic do?
AReduces the topic size
BDeletes old messages automatically
CAllows more consumers to read in parallel
DPrevents message duplication
If a Kafka message has no key, how is its partition chosen?
ARound-robin distribution across partitions
BAlways assigned to partition 0
CBased on the message timestamp
DRandomly assigned to any partition
Can you decrease the number of partitions in a Kafka topic after creation?
AYes, anytime without issues
BNo, Kafka does not support decreasing partitions
COnly if the topic is empty
DOnly with a broker restart
What is a risk of having too many partitions in Kafka?
AIncreased overhead and complexity
BConsumers cannot connect
CMessages get lost
DLower parallelism
Which factor is NOT important when deciding partition count?
AExpected message throughput
BBroker hardware limits
CNumber of consumer instances
DColor of the server hardware
Explain how Kafka uses partitions to improve message processing.
Think about how dividing data helps multiple consumers work at the same time.
You got /4 concepts.
    Describe the considerations when choosing the number of partitions for a Kafka topic.
    Balance performance needs with system complexity.
    You got /4 concepts.