Quick revision
The short answer
Size each group from measured per-consumer throughput, usually limited by decompression, deserialisation and the sink: at 50 MB/s per consumer, 1.5 GB/s needs about 30 consumers per group and at least that many partitions, more for catch-up headroom. Three groups read 4.5 GB/s from brokers on top of produce and replication traffic, so broker network is the first limit; follower fetching with client.rack spreads reads and avoids cross-zone transfer. Tune the real-time group for latency and the lake loader and indexer for large fetches, put byte-rate quotas on the bulk groups, and plan capacity so each group can clear a one-hour backlog of about 5.4 TB.
What to remember
In this answer, we sized three consumer groups for a 1.5 GB/s topic from measured per-consumer throughput: about 30 consumers per group at 50 MB/s, with partitions chosen for catch-up headroom. Three groups mean 4.5 GB/s of reads on top of produce and replication, so broker network is the first limit, and follower fetching with client.rack spreads reads and avoids cross-zone transfer. The real-time group is tuned for latency and the bulk groups for large fetches, quotas keep catch-up from starving the real-time group, and a one-hour outage means about 5.4 TB per group to clear.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
Size each group from measured per-consumer throughput, usually limited by decompression, deserialisation and the sink: at 50 MB/s per consumer, 1.5 GB/s needs about 30 consumers per group and at least that many partitions, more for catch-up headroom. Three groups read 4.5 GB/s from brokers on top of produce and replication traffic, so broker network is the first limit; follower fetching with client.rack spreads reads and avoids cross-zone transfer. Tune the real-time group for latency and the lake loader and indexer for large fetches, put byte-rate quotas on the bulk groups, and plan capacity so each group can clear a one-hour backlog of about 5.4 TB.
Why this question is asked
A topic at 1.5 GB/s is big enough that every per-byte cost becomes a capacity question: client CPU, broker network cards and cross-zone transfer bills. Interviewers ask this design question to see whether we reason from numbers, notice that every consumer group multiplies broker reads, and protect a latency-sensitive group from bulk readers. In this answer, we will recap the constraints, size the groups, account for broker load and zones, choose fetch settings per group, add quotas, and plan for catch-up.
1A Quick Recap of the Constraints
A consumer group spreads a topic's partitions over its members, and each partition is read by one member, so a group can never use more consumers than there are partitions. Every group reads the full topic independently, so three groups mean three full copies of the read traffic. And in a three-zone cluster, each partition's leader lives in one zone, so by default two thirds of consumers read from a leader in another zone, paying cross-zone latency and, in most clouds, a transfer charge per gigabyte.
2Sizing Each Group
The number of consumers comes from measured throughput per consumer, not from the topic rate alone. For compressed data, a consumer's throughput is usually limited by CPU for decompression and deserialisation, and by the sink it writes to. Suppose a load test shows 50 MB/s of compressed input per consumer for each of the three jobs.
Notice that partitions are the ceiling on parallelism, so we choose them for the headroom we want, not the steady state. 96 partitions let any group scale to 96 consumers. Each group can also measure differently: the indexer may manage only 30 MB/s per consumer if the search cluster is slow, which would mean 50 consumers in steady state.
3Broker Load and the Three Zones
Add up the broker traffic. Producers write 1.5 GB/s. With replication factor 3, followers copy another 3 GB/s between brokers. The three groups read 4.5 GB/s. That is 9 GB/s of traffic, most of it outgoing from brokers, and this is usually the first limit we hit: broker network interfaces, before disks or CPU.
Follower fetching helps twice. With the broker setting replica.selector.class=org.apache.kafka.common.replica.RackAwareReplicaSelector, each broker's broker.rack set to its zone, and each consumer's client.rack set to its own zone, consumers read from a replica in their own zone instead of always from the leader. Reads spread over all three replicas rather than piling on leaders, and cross-zone transfer for consumers drops to almost nothing, which at 4.5 GB/s is a large monthly cost. The trade-off is slightly higher end-to-end latency, because a follower serves data only once it has replicated it.
- Producers1.5 GB/s into leaders
- Replication3 GB/s leader to followers (RF 3)
- Real-time enrichment group1.5 GB/s, same-zone replicas via
client.rack - Lake loader group1.5 GB/s, quota-limited during catch-up
- Search indexer group1.5 GB/s, quota-limited during catch-up
5 layers, from the top down. Step through them one at a time.
9 GB/s in total: broker network is the first ceiling, so reads are spread over replicas and zones.
4Fetch Settings per Group
The groups want different things. The real-time enrichment service cares about latency, so it keeps fetch.min.bytes small (the default 1 byte, or a few KB) and fetch.max.wait.ms short, around 100 ms, and keeps max.partition.fetch.bytes near the 1 MB default. The lake loader and the indexer batch their writes anyway, so they ask for big responses: fetch.min.bytes of about 1 MB, fetch.max.wait.ms of 500 ms, and max.partition.fetch.bytes of a few MB, which cuts the number of fetch requests and broker CPU per byte.
Bigger fetches cost memory, roughly partitions per consumer times max.partition.fetch.bytes in the worst case, so with about three partitions per consumer a few MB per partition is safe.
| Setting | Real-time enrichment | Lake loader and indexer |
|---|---|---|
fetch.min.bytes | 1 byte to a few KB | about 1 MB |
fetch.max.wait.ms | about 100 ms | 500 ms |
max.partition.fetch.bytes | 1 MB (default) | 4 MB to 8 MB |
client.rack | own zone | own zone |
| Quota | none | consumer byte-rate quota |
5Quotas and Catch-Up
After an outage, the bulk groups will try to read as fast as possible. Without limits, the lake loader and indexer catching up at 3 GB/s each could saturate broker networks and push the real-time group's latency up exactly when the business is recovering. Consumer byte-rate quotas, set per client id or user with kafka-configs.sh, cap each bulk group's read rate, for example at 2.5 GB/s per group, leaving room for the real-time group.
Now the catch-up arithmetic. A one-hour outage leaves 1.5 GB/s times 3,600 s, about 5.4 TB, per group to clear. If a group can read at twice the normal rate, 3 GB/s, its surplus over the incoming 1.5 GB/s is 1.5 GB/s, so clearing 5.4 TB takes another hour. If that is too slow, the group needs more headroom, and the brokers need the network capacity to serve it. Topic retention must comfortably exceed the longest outage we plan for, so the backlog is still there to read.
6Follow-up questions
Which limit will we hit first?
Usually broker network egress, because reads multiply with each group and replication doubles the write traffic. Next comes consumer CPU for decompression and deserialisation, then the sinks: the search cluster's indexing rate often limits the indexer before Kafka does. Measuring each in a load test tells us the actual order for our hardware.
Should the real-time group also use follower fetching?
Usually yes, for cost and to spread load, but followers serve records only after they have replicated them, adding a little latency. If the real-time group has a very tight latency target, we can let it read from leaders and keep follower fetching for the bulk groups.
7Conclusion
In this answer, we sized three consumer groups for a 1.5 GB/s topic from measured per-consumer throughput: about 30 consumers per group at 50 MB/s, with partitions chosen for catch-up headroom. Three groups mean 4.5 GB/s of reads on top of produce and replication, so broker network is the first limit, and follower fetching with client.rack spreads reads and avoids cross-zone transfer. The real-time group is tuned for latency and the bulk groups for large fetches, quotas keep catch-up from starving the real-time group, and a one-hour outage means about 5.4 TB per group to clear.
Open with
I would size from measurement, not from the topic rate. In a load test I measure what one consumer can do for each job, because decompression, deserialisation and the sink usually limit it.
Then, if they want more
Say it is 50 megabytes a second; then 1.5 gigabytes a second needs 30 consumers per group, and I want twice that for catch-up, so at least 60 partitions, probably 96 so groups can grow. Then broker load: three groups read 4.5 gigabytes a second, on top of 1.5 in and 3 more for replication at factor three.
Broker network is the first wall. I would enable follower fetching: rack-aware replica selector on the brokers, broker.rack per zone, client.rack on each consumer, so reads come from a same-zone replica, which spreads load and removes most cross-zone transfer.
Fetch settings differ by group: the real-time group keeps fetch.min.bytes tiny and fetch.max.wait.ms around 100 milliseconds, while the lake loader and indexer use about a megabyte minimum, 500 milliseconds, and a few megabytes per partition. I would put byte-rate quotas on the two bulk groups so their catch-up after an outage cannot starve the real-time group.
And I would plan catch-up explicitly: one hour down is about 5.4 terabytes per group, and at twice normal speed that takes another hour to clear.
About this answer
- Last updated
- 13 November 2026
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
- Official documentation
- Apache Kafka documentation
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "Design the consumer side for a topic carrying 1.5 GB/s of compressed data read by three...": https://scrivio-interview-library.netlify.app/spring-boot/kafka-clients-in-depth/295daee1bc/