Skip to main content

Question 23 of 50

What happens when there are more consumers than Partitions?

Mid-levelSenior

Question

"What happens if a Consumer Group has more consumer instances than the topic has Partitions?"

What the interviewer wants to assess

Whether you understand the real parallelism limit imposed by partitions — a common mistake is assuming adding consumers always increases throughput.

Resposta rápida

The extra consumers sit idle, processing nothing, because there's no partition left to assign them. They only start receiving partitions if another consumer in the group goes down or leaves.

Resposta nível Sênior

The rule is one partition, one consumer, per Consumer Group — never two instances from the same group reading the same partition at the same time. If the topic has 4 partitions and the group scales to 6 instances, 2 of them are completely idle, receiving no assignment at all. This surprises teams that scale consumers via Kubernetes/HPA expecting proportional throughput gains, without considering that the number of partitions is the real parallelism ceiling — scaling beyond that number adds zero processing capacity, it just wastes resources.

In-depth explanation

See "What happens with different numbers of consumers" in Chapter 6.

Exemplo financeiro

The antifraude-service runs with 4 partitions on the topic and scales to 6 replicas for Black Friday expecting more throughput — but 2 replicas sit idle, because there are no partitions left, and actual throughput doesn't change.

"More consumers always means more throughput"

Only up to the number-of-partitions limit. Beyond that, every additional consumer is pure wasted compute, with no processing gain whatsoever.

Pode vir a seguir

Likely follow-ups: "what if there are more Partitions than consumers?" and "how would you size a consumer's number of replicas on Kubernetes?".