← Lessons

quiz vs the machine

Silver1100

System Design

Partition Assignment

How partitions get spread across consumers in a group for parallel reads.

4 min read · intro · beat Silver to climb

Partitions enable parallelism

A topic is split into partitions, each an independent ordered log. Within a consumer group, each partition is read by exactly one consumer at a time. So the number of partitions sets the maximum parallelism: ten partitions allow at most ten active consumers.

Assignment strategies

  • Range: assigns contiguous blocks of partitions per topic to each consumer.
  • Round robin: spreads partitions evenly across all consumers, good for balance.
  • Sticky: keeps assignments stable across rebalances to reduce churn.

Rebalancing

When a consumer joins or leaves, the group rebalances and partitions are reassigned. During this the group pauses briefly. Frequent rebalances hurt throughput, so sticky strategies aim to move as few partitions as possible.

Flow

Key idea

Partition count caps consumer parallelism; assignment strategies balance load while sticky assignment minimizes disruptive rebalancing.

Check yourself

Answer to earn rating on the learn ladder.

1. What limits the number of active consumers in a group?

2. Why prefer a sticky assignment strategy?