Lesson 12 · Senior Kafka practice
Partition strategy, hotspots, and parallelism trade-offs
How partition count, key choice, and uneven traffic shape throughput, ordering, and operational pain.
Your win: explain how to choose partition strategy from the workload, not from a default number, and how hotspots appear when one key or one partition attracts too much traffic.
Why this page matters more than it first looks
Earlier lessons taught the mechanics cleanly: a topic is split into partitions, a key influences where a record lands, and consumer groups only parallelize up to the partition count. That is the beginner-to-intermediate reading.
The senior reading is different. Partition count is not just a Kafka setting. It is a hidden product decision about how much concurrency the workload can use, how much ordering the domain truly needs, and how much operational overhead the team is willing to absorb later.
That is why this topic matters more than it first looks. A bad partition strategy may still work in development. It starts hurting only when traffic becomes uneven, one tenant dominates the stream, or a consumer group needs more parallelism than the topic shape allows.
What a hotspot really is
A hotspot is not a mysterious Kafka bug. It is the place where your workload shape becomes visible in the partition layout. If one tenant, one aggregate id, or one customer creates a disproportionate amount of traffic, Kafka can distribute records exactly as instructed and still leave you with one overloaded partition.
This is the key mindset shift: Kafka hashes keys faithfully, but it cannot rescue a skewed domain model. If the same key must preserve ordering, then that key may also become the center of pressure. The senior question is whether that is necessary for correctness or whether the domain could tolerate a different keying rule.
Revisit partitions with a senior lens
Go back to the Kafka design material and read the partition section again, but this time as a workload-shaping decision rather than a vocabulary section.
Check yourself (from memory)
Q1. What is the most senior way to think about partition count?
Sources. Kafka design docs; repo Kafka map.