Documents
Kafka

Partitions and Consumer Groups

Why ordering is per-partition, and why extra consumers buy you nothing.

Placeholder content. Written to exercise the standalone .puml embed and a table. Replace the prose before publishing.

Kafka is an append-only distributed log. Most questions reduce to two facts: ordering is per-partition, and consumers track their own offsets.

Kafka cluster topology

Partitions decide everything

  • A topic is split into partitions; each partition is an ordered, immutable sequence
  • Ordering is guaranteed within a partition, never across a topic
  • The partition is chosen by hash(key) % partitionCount, so the key is what buys you ordering
  • Partition count can grow but never shrink, and growing it rehashes future keys

Consumer groups

Each partition is consumed by exactly one member of a group, which is why adding consumers beyond the partition count buys nothing.

Consumers in groupPartitionsResult
24Each consumer owns 2 partitions
44One partition each, maximum parallelism
642 consumers idle

On this page