Quick revision
The short answer
About 1,600 MB/s crosses zones: roughly 200 MB/s of produce traffic to leaders in other zones, 600 MB/s of replication to followers in the two other zones, and about 800 MB/s of consumer reads from leaders in other zones. Follower fetching with client.rack removes most of the 800 MB/s of consumer traffic, roughly halving the total. Replication cannot be removed by client settings, and produce traffic can only be cut by zone-aware producers or partition choices that conflict with key-based ordering.
What to remember
In this answer, we estimated cross-zone traffic for three zones, replication factor 3 and 300 MB/s of produce: about 200 MB/s of produce to remote leaders, 600 MB/s of replication and about 800 MB/s of consumer reads, roughly 1,600 MB/s in total. Follower fetching with broker.rack, RackAwareReplicaSelector and client.rack removes most of the consumer share and roughly halves the total, while replication stays by design and produce traffic could only be cut with zone-aware partitioning that conflicts with key-based ordering.
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.
About 1,600 MB/s crosses zones: roughly 200 MB/s of produce traffic to leaders in other zones, 600 MB/s of replication to followers in the two other zones, and about 800 MB/s of consumer reads from leaders in other zones. Follower fetching with client.rack removes most of the 800 MB/s of consumer traffic, roughly halving the total. Replication cannot be removed by client settings, and produce traffic can only be cut by zone-aware producers or partition choices that conflict with key-based ordering.
Why this question is asked
Cross-zone data transfer is one of the biggest and least visible costs of running Kafka in the cloud, and it is billed per GB, often in both directions. A platform engineer who can estimate it from first principles can tell quickly whether a change is worth making. Interviewers ask this scenario to check that we understand which flows cross zones and which settings change each of them. In this answer, we will set up the model, estimate each flow in turn, add them up, then apply rack-aware settings and see what remains and why.
1Setting Up the Model
Three zones, call them a, b and c. Every partition has three replicas, one per zone, and its leader is in one of them. Leaders are spread evenly, so a third of leaders are in each zone. Producers are also spread evenly across zones and write 300 MB/s in total. Four consumer groups each read all 300 MB/s.
The key assumption is that a client's zone and a partition leader's zone are independent. So for any client, there is a one in three chance that the leader it talks to is in its own zone, and a two in three chance that the traffic crosses a zone boundary.
2Flow by Flow
Produce: two thirds of 300 MB/s goes to a leader in another zone, which is 200 MB/s.
Replication: every byte written to a leader is fetched by two followers, each in one of the other two zones. That is 2 x 300 = 600 MB/s, all of it cross-zone by design. This is the price of surviving a zone failure.
Consumers: four groups reading 300 MB/s each is 1,200 MB/s. Two thirds of it is read from leaders in other zones, so about 800 MB/s.
| Flow | Before | After follower fetching |
|---|---|---|
| Produce to leaders | ~200 MB/s | ~200 MB/s |
| Replication to followers | 600 MB/s | 600 MB/s |
| Consumer reads (4 groups) | ~800 MB/s | ~0 to 100 MB/s |
| Total | ~1,600 MB/s | ~800 to 900 MB/s |
The total is about 1,600 MB/s. To see what that means, 1.6 GB/s is about 138,000 GB per day. If the provider charges, for example, 0.01 dollars per GB in each direction, that is about 0.02 dollars per GB moved, or roughly 2,800 dollars per day and 80,000 dollars per month. Prices differ by provider and change over time, so check yours, but the order of magnitude is why this matters.
3What Rack-Aware Settings Remove
With broker.rack on every broker, replica.selector.class set to RackAwareReplicaSelector, and client.rack on every consumer, each consumer fetches from the replica in its own zone. Because every partition has a replica in every zone, almost all 800 MB/s of consumer traffic stays inside a zone. What remains is small: brief periods when a follower is out of sync and consumers fall back to the leader, and any consumers that do not set client.rack.
So the bill falls by roughly half. There is a small cost: followers serve data only up to the high watermark they have learned from the leader, which adds a few milliseconds of end-to-end latency. For most consumers that is a good trade. Notice too that every additional consumer group would add another 200 MB/s of cross-zone traffic without follower fetching, so the saving grows as the number of groups grows.
4Why Replication and Produce Traffic Stay
Replication is what makes the cluster survive a zone outage, so no client setting removes it. The only levers are on the data itself: compression, so there are fewer bytes to copy, or a smaller replication factor for data that can be lost, which is a business decision. Shorter retention or tiered storage does not help here, because replication happens at write time.
Produce traffic crosses zones because the partition decides the leader, and the leader may be in another zone. To avoid that, a producer would have to write only to partitions whose leaders are in its own zone. For keyless records, a zone-aware partitioner could do that. But for keyed records the partition is fixed by the key's hash, and choosing partitions by zone would break per-key ordering. Some managed and diskless systems offer zone-aware produce paths; in Apache Kafka it is a custom design. At about 200 MB/s, it may be worth it, but only if the saving justifies a custom partitioner and its risks.
5Follow-up questions
Does follower fetching increase load on followers?
Yes. Followers now serve consumer fetches as well as their own replication, so read load spreads over all three replicas instead of only the leaders. That usually balances the cluster better, but we should check that brokers have the network and CPU headroom, and that consumers reading old data from followers do not hurt their replication.
How would you verify the saving after the change?
Compare the provider's cross-zone transfer metrics or bill lines before and after, and on the Kafka side, check per-broker bytes out and confirm that consumers report fetching from preferred read replicas. Network flow logs grouped by source and destination zone show it most directly.
6Conclusion
In this answer, we estimated cross-zone traffic for three zones, replication factor 3 and 300 MB/s of produce: about 200 MB/s of produce to remote leaders, 600 MB/s of replication and about 800 MB/s of consumer reads, roughly 1,600 MB/s in total. Follower fetching with broker.rack, RackAwareReplicaSelector and client.rack removes most of the consumer share and roughly halves the total, while replication stays by design and produce traffic could only be cut with zone-aware partitioning that conflicts with key-based ordering.
Open with
I would model it flow by flow, assuming clients and leaders are spread evenly over three zones, so any client has a two in three chance of talking to a leader in another zone.
Then, if they want more
Produce: 300 MB/s, two thirds cross zones, so about 200 MB/s. Replication: every byte goes to two followers, one in each other zone, so 600 MB/s, all cross-zone by design. Consumers: four groups at 300 MB/s is 1,200 MB/s, and two thirds of that is about 800 MB/s. Total is roughly 1,600 MB/s.
At something like 0.02 dollars per GB moved, that is in the region of 80,000 dollars a month, though I would check the provider's actual price. Now rack awareness: set broker.rack on the brokers, replica.selector.class to RackAwareReplicaSelector, and client.rack on consumers.
Every partition has a replica in every zone, so consumers read from their own zone and nearly all of the 800 MB/s disappears. The total drops to about 800 MB/s, roughly half, and the saving grows with every new consumer group.
The cost is a few milliseconds of extra end-to-end latency, because followers only serve up to the high watermark they know. Replication cannot be removed by any client setting; it is what makes us survive a zone loss.
Produce traffic could only be cut with a zone-aware partitioner, which breaks key-based ordering, so I would only do that for keyless data and if the saving clearly justifies it.
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 "Estimate the cross-zone traffic per second, and show how much rack-aware settings can...": https://scrivio-interview-library.netlify.app/spring-boot/kafka-internals/78430c006e/