Quick revision
The short answer
Allocate cost with drivers that teams control and we can measure per principal and topic: bytes produced, bytes consumed including fan-out, storage retained including replicas, partitions and cross-zone traffic, with shared overhead spread proportionally. Run showback for a few quarters first, with monthly reports that name each team's largest drivers and concrete savings, make an owning team mandatory for every topic and group, and keep incentives sane: the platform stays cheaper than running your own Kafka, reliability settings are not penalised, and experiments are funded centrally. Then track cost per GB, idle resources and growth, and review the model yearly with finance and the teams.
What to remember
In this answer, we saw that the cluster feels free because cost and decisions are disconnected. We chose drivers teams control and can measure, such as bytes produced and consumed, retained storage, partitions and cross-zone traffic, ran showback before any chargeback, made ownership of every topic and group mandatory with cleanup of unowned resources, kept incentives sane by staying cheaper than private clusters and never charging for reliability, and tracked outcomes with a yearly review.
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.
Allocate cost with drivers that teams control and we can measure per principal and topic: bytes produced, bytes consumed including fan-out, storage retained including replicas, partitions and cross-zone traffic, with shared overhead spread proportionally. Run showback for a few quarters first, with monthly reports that name each team's largest drivers and concrete savings, make an owning team mandatory for every topic and group, and keep incentives sane: the platform stays cheaper than running your own Kafka, reliability settings are not penalised, and experiments are funded centrally. Then track cost per GB, idle resources and growth, and review the model yearly with finance and the teams.
Why this question is asked
When a resource is free to its users, it grows without limit, and a shared Kafka cluster is no exception. Topics with 30-day retention that nobody reads, consumer groups with no owner and uncompressed producers all cost money that appears only on the platform team's budget. Finance asking for allocation is an opportunity, but a badly designed charge can push teams away from the platform or toward unsafe settings. Interviewers ask this to see whether we can design a cost model that changes behaviour without damaging the thing it measures. In this answer, we will look at why the cluster feels free, choose cost drivers, start with showback, make ownership mandatory, keep incentives sane, and measure the outcome.
1Why the Cluster Feels Free
A team that adds a topic or doubles its retention sees no bill and no consequence. The cost appears months later as more brokers on the platform budget, with no link back to the decision that caused it. So the people who can save money do not see the cost, and the people who see the cost cannot save money. Costs tripling in two years is the natural result.
The goal of showback or chargeback is to reconnect the two: let each team see what its choices cost in a form it can act on. The money transfer is secondary; the information is what changes behaviour.
2Choosing Cost Drivers Teams Can Control
A good driver has two properties: we can measure it per team, and the team can change it. Total cluster cost split by headcount fails both tests. Instead, we pick the things that actually drive our hardware and cloud bill and attribute each to the owning team of a topic or a consumer group.
| Driver | How we measure it | What the team can change |
|---|---|---|
| Bytes produced | Per-topic BytesInPerSec, topic owner | Compression, payload size |
| Bytes consumed (fan-out) | Per-principal fetch bytes or group progress | Fewer re-reads, shared consumers |
| Storage incl. replicas | Log sizes per topic | Retention, compaction, compression |
| Partitions | Partition count per topic | Right-size partition counts |
| Cross-zone traffic | Rack-aware estimates per client | Follower fetching, zone-local clients |
Bytes produced and storage are attributed to the topic's owner; bytes consumed to the consuming team, so a topic read by ten teams does not bill its producer for everyone's fan-out. Shared overhead, such as controllers, monitoring and the platform team, is spread in proportion to each team's direct cost. A worked example keeps it concrete: a team producing 2 TB a day, keeping 30 days with replication factor 3, retains 180 TB of disk; cutting retention to 7 days removes about 138 TB, which at a cost of, say, 0.08 dollars per GB-month is roughly 11,000 dollars a month. That kind of number is what makes a report actionable.
3Showback Before Chargeback
We start with showback: monthly reports to each team showing its cost, its largest drivers and a short list of concrete savings, such as enabling zstd compression on two producers, shortening retention on three topics nobody reads after a day, and deleting four idle topics. No money moves for the first few quarters.
The reason is trust. The first reports will contain errors in attribution, and teams need time to question them, see them corrected and make changes. If money moves on day one, every error becomes a budget fight and the model loses credibility. After a few quarters the model is accurate, teams have taken the easy savings, and finance can decide whether to move to chargeback with the numbers already familiar.
- Catalogue owners for topics and groupsno owner, no allocation
- Showback reports monthlydrivers, top savings, trend
- Teams act on savingscompression, retention, cleanup
- Model accurate and trusted?YesMove to chargeback with financeNoAnother quarter of showback
- Review drivers and rates yearlywith finance and teams
5 steps in order. Play them, or step through them one at a time.
4Ownership Is Mandatory
Allocation is impossible without owners, and so is cleanup. Every topic and consumer group must have an owning team recorded in the catalogue, which the provisioning pipeline already requires for new resources. For the existing ones, we publish a list of unowned topics and groups, give teams a notice period to claim them, and then remove the unclaimed ones after a final warning, archiving data first where anyone asks.
Idle detection supports this: topics with no produce and no consume traffic for 30 days, and consumer groups with no members for 30 days, are flagged to their owners automatically. Much of the early saving usually comes from here, before any behaviour change by active teams.
5Keeping the Incentives Sane
A cost model changes behaviour, and not always in the direction we want, so we design against the bad outcomes. First, the platform must stay cheaper than any team running its own Kafka; if our rate per GB looks expensive, teams will build private clusters that cost the company more. Second, we never charge for reliability: replication factor 3 is a platform standard, so storage is charged per logical GB with the replication cost spread evenly, and nobody saves money by dropping to one replica. Third, new teams and experiments get a central allowance, so trying the platform is free and adoption does not stall.
We also avoid making the model so precise that it is impossible to understand. Five drivers that a team lead can explain in a minute beat twenty that only the platform team understands.
6Measuring Whether It Works
The model is a means, so we track outcomes: cost per GB moved and stored, the share of idle topics and groups, the share of producers with compression, and total growth compared with business growth. If costs grow slower than traffic and idle resources fall, the model is working. Once a year we review drivers, rates and exceptions with finance and team representatives, because the right drivers change as the platform does, for example when tiered storage makes long retention much cheaper.
7Follow-up questions
How do you attribute consumption when many teams read one topic?
Each consuming team pays for its own reads, measured by its principal's fetch bytes where quota metrics are available, or estimated from its group's offset progress times the average record size. The producer pays for writing and storing the data once.
What if a team says its high cost is required by the business?
Then the cost is legitimate and showback simply makes it visible to whoever funds that team. The goal is not to minimise every cost but to make sure each one is a conscious choice.
Should the platform team itself be charged?
Its own tooling, such as canaries and monitoring topics, is part of shared overhead, spread proportionally. That keeps the platform's incentive to stay efficient visible in the rate it publishes.
8Conclusion
In this answer, we saw that the cluster feels free because cost and decisions are disconnected. We chose drivers teams control and can measure, such as bytes produced and consumed, retained storage, partitions and cross-zone traffic, ran showback before any chargeback, made ownership of every topic and group mandatory with cleanup of unowned resources, kept incentives sane by staying cheaper than private clusters and never charging for reliability, and tracked outcomes with a yearly review.
Open with
I would start by picking cost drivers that teams control and that we can measure per principal and topic: bytes produced, bytes consumed so fan-out lands on the consuming team, storage retained including replicas, partition count, and cross-zone traffic.
Then, if they want more
Shared overhead like controllers and the platform team is spread proportionally. Then I would run showback, not chargeback, for a few quarters: a monthly report per team with its cost, its top drivers and concrete savings, like turning on zstd compression, cutting 30-day retention on topics nobody reads after a day, and deleting idle topics.
That builds trust and lets us fix attribution errors before money moves. Ownership becomes mandatory: every topic and consumer group needs an owning team in the catalogue, and unowned or idle resources are flagged and removed after notice. I would be careful with incentives.
The platform has to stay cheaper than any team running its own Kafka, otherwise we push them to private clusters. We do not charge for reliability settings like replication factor three, so nobody saves money by being unsafe. And new teams and experiments get a central allowance so adoption does not suffer.
Finally, I track outcomes, cost per GB, idle resources, compression adoption and growth against business growth, and review the model yearly with finance and the teams.
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 "How would you design showback or chargeback for Kafka, and how do you use it to change...": https://scrivio-interview-library.netlify.app/spring-boot/kafka-operations/8d8e541d60/