Partition = ordering unit

Order guaranteed WITHIN a partition. Across partitions, no ordering. Choose key so same-key messages hash to same partition.

Advertisement

Partition = ordering unit

Order guaranteed WITHIN a partition. Across partitions, no ordering. Choose key so same-key messages hash to same partition.

Advertisement

Partition count = max parallelism

N consumers in a group ≤ N partitions. Add partitions to enable more consumers. Reducing is hard.

Producer key routing

hash(key) mod partition_count. Same key → same partition. No key → round-robin.

Consumer groups

All consumers in group share partitions. Different groups get full copy of stream. Great for fan-out.

Rebalancing pain

Consumer joins/leaves → partitions reassign. Cooperative rebalancing (Kafka 2.4+) minimizes disruption.