Skip to content
BENIBIX Learn

Kafka Partition

Also known as Topic Partition, Partition Key

One ordered slice of a topic. More slices let more readers work at once.

Think of it like

It is like the lanes at a supermarket till. More lanes serve more people, but each lane has its own line.

Example

Orders are keyed by customer ID. All of Lucy's orders land in partition 2, so they are read in the order she placed them.

Why it matters

Partitions let Kafka grow. They also decide which events stay in order.

Definition

A Kafka partition is one ordered slice of a topic. Each event in it gets the next number, called an offset. Order is kept inside a partition. It is not kept across partitions. Events with the same key always go to the same partition. More partitions let more consumers read at once.
A topic is split into partitions. Each consumer in a group reads its own, and remembers its place.

Common mistake

Expecting order across a whole topic. Only events in one partition stay in order. Those are events with the same key.

Key takeaways

  1. 1
    Ordered inside. Not across partitions.
  2. 2
    Same key, same partition. Keys keep related events together.
  3. 3
    Parallel reads. One reader per partition in a group.

Compare