Choosing a partitioning strategy — how events are distributed across a topic's partitions — is an important Kafka design decision affecting ordering, parallelism, and load distribution. The partition key and count must be chosen carefully.
How partitioning works
A producer's message goes to a partition based on:
→ with a KEY → hash(key) → determines the partition (same key → same partition consistently)
→ no key → distributed (round-robin / sticky) across partitions
→ the KEY choice determines ordering and distribution
