Quick revision
The short answer
Billing-grade usage data needs every event counted exactly once, kept auditable for years and reproducible when a customer disputes an invoice, while an operational metrics platform is built to tolerate loss, drop late data, downsample and approximate. So usage lives as durable events in a log or object storage, aggregated by idempotent, replayable jobs into a transactional or immutable store, and invoices come only from that pipeline. Metrics may still display usage, reconciled against billing as a health check, and a written policy says which data classes need exactness and which systems are approved for each.
What to remember
In this answer, we saw that operational metrics tolerate loss, late data, downsampling and approximation, while billing needs exact, auditable, reproducible counts. Billing usage should therefore be durable events in Kafka and object storage, aggregated by idempotent, replayable jobs into a transactional or immutable store, with invoices computed only from it. The metrics platform can still display usage, reconciled daily against billing. A written policy for data classes decides where future data lives, and the cost of a second pipeline is presented next to the cost of billing errors.
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.
Billing-grade usage data needs every event counted exactly once, kept auditable for years and reproducible when a customer disputes an invoice, while an operational metrics platform is built to tolerate loss, drop late data, downsample and approximate. So usage lives as durable events in a log or object storage, aggregated by idempotent, replayable jobs into a transactional or immutable store, and invoices come only from that pipeline. Metrics may still display usage, reconciled against billing as a health check, and a written policy says which data classes need exactness and which systems are approved for each.
Why this question is asked
Reusing data that already exists is usually good engineering, so the product team's proposal sounds reasonable. The trouble is that two kinds of time series that look the same, a number per customer per minute, have completely different promises behind them. Interviewers ask this leadership question to see whether we can explain that difference in terms a product leader accepts, design the right pipeline, and set a principle that prevents the same debate next quarter. In this answer, we will compare what operational metrics and billing data promise, design a billing usage pipeline, decide the role of the metrics platform, write the data class policy, present the cost honestly, and handle events that arrive days late.
1What Each Kind of Data Promises
An operational metrics platform, such as Prometheus with Thanos or Mimir, or a hosted equivalent, is designed so that dashboards and alerts stay fast and cheap at enormous scale. To get there it accepts compromises. A scrape that fails loses those samples. Samples that arrive too late are dropped. Old data is downsampled to 5-minute or 1-hour resolution. Percentiles are approximate. Counters that reset are interpreted with heuristics. None of that matters when the question is whether the API is healthy.
Billing asks a different question: exactly how much did this customer use, and can we prove it? Every usage event must be counted once, not zero times and not twice. The raw data must be kept for as long as invoices can be disputed or audited, often years. And the calculation must be reproducible: given the same events and the same price rules, we must produce the same invoice line next year. A lost scrape on a metrics platform is a gap on a chart; on an invoice it is lost revenue or an overcharge.
| Property | Operational metrics | Billing usage |
|---|---|---|
| Loss of samples | tolerated | not acceptable |
| Late data | often dropped | must be counted, with a rule for which period |
| Resolution over time | downsampled | raw events kept for the audit period |
| Precision | approximate is fine | exact, reproducible |
| Retention | weeks to months | years |
2A Pipeline Built for Billing
Usage starts as events, each with a unique event id, the customer, the quantity, and the time it happened. Services publish them to a durable log such as Kafka with long retention, and every event is also archived to object storage as immutable files, which gives cheap retention for years and a complete source for replays.
Aggregation jobs read the events, deduplicate by event id, and sum usage per customer, product and minute or hour into a store with transactions or immutable partitions, such as PostgreSQL for moderate volume or a warehouse table partitioned by day. The jobs are idempotent: running one twice for the same period produces the same result, because it rewrites that period from the events rather than adding to it. So if a bug is found, we fix it and replay the period. The invoice generator reads only this store, and each invoice records the versions of the data and the price rules it used.
- Services emit usage eventsunique event id, customer, quantity, event time
- Kafka with long retentionplus immutable archive in object storage
- Idempotent aggregation jobsdedupe by event id, rewrite whole periods
- Usage storetransactional or immutable partitions
- Invoice generationrecords data and price versions used
5 layers, from the top down. Step through them one at a time.
3Where the Metrics Platform Still Fits
We do not need to hide usage from the metrics platform. It is useful for product and operations teams to see usage per customer on dashboards, and to alert on sudden drops that might mean a broken emitter. The rule is that invoices are computed only from the billing pipeline. The two can then check each other: a daily reconciliation compares usage totals per customer from both, and a difference beyond a small threshold raises an alert. That turns the duplicate data into a health check rather than a source of disagreement.
4A Policy for Data Classes
The lasting outcome should be a short written policy, not a one-off decision. It defines data classes, for example operational telemetry, product analytics, and financial or contractual data, and for each class states the exactness required, the retention, the audit needs, privacy and access controls, and the systems approved to hold it. Billing usage is financial data, so it must live in systems approved for that class. When the next team wants to bill on a new metric, the policy answers the question before the debate starts.
5Presenting the Cost Honestly
A second pipeline is real cost: engineering time to build it, storage, and a team to own it. A leader should say so with numbers, for example a few engineer-months to build and a modest monthly run cost. Next to it goes the cost of billing from metrics: if even 0.5 percent of samples are lost or double-counted on a usage line worth millions a year, that is tens of thousands of dollars misbilled, and every dispute we cannot reproduce costs credits, support time and customer trust. Put side by side, the decision usually makes itself, and leadership owns it with full information.
6Follow-up questions
How would you handle usage events that arrive days late after an outage?
The pipeline keeps event time and processing time separate. Late events are accepted and land in the usage store for the period in which the usage happened. If that period is still open, they simply join it. If its invoice has already been issued, the policy decides: usually the late usage is billed as an adjustment line on the next invoice, clearly labelled, rather than reissuing the old invoice. Because jobs are idempotent and replayable, reprocessing the affected days is safe, and a report shows how much usage arrived late per period.
Why not just make the metrics platform lossless?
Because its design choices, scraping, dropping late data, downsampling, are what make it cheap and fast for its main job. Making it billing-grade would make it slower and more expensive for everyone, and it would still lack the audit and replay features billing needs.
What makes a usage event safe to count exactly once?
A unique, deterministic event id created by the emitter, so retries produce the same id, and deduplication by that id in the aggregation. Exactly-once delivery is not required if counting is idempotent.
7Conclusion
In this answer, we saw that operational metrics tolerate loss, late data, downsampling and approximation, while billing needs exact, auditable, reproducible counts. Billing usage should therefore be durable events in Kafka and object storage, aggregated by idempotent, replayable jobs into a transactional or immutable store, with invoices computed only from it. The metrics platform can still display usage, reconciled daily against billing. A written policy for data classes decides where future data lives, and the cost of a second pipeline is presented next to the cost of billing errors.
Open with
I would start by separating what the two kinds of data promise. Our metrics platform is built for dashboards and alerts, so it tolerates lost scrapes, drops late samples, downsamples old data and approximates percentiles.
Then, if they want more
Billing needs every usage event counted exactly once, kept for years for audit, and reproducible if a customer disputes an invoice. So I would not bill from the metrics platform.
Usage should be emitted as events with unique ids, written to Kafka with long retention and archived to object storage, and aggregated by idempotent jobs that dedupe by event id and can replay any period, into a transactional store or immutable partitions. Invoices are computed only from there.
Usage can still appear on metrics dashboards, and a daily reconciliation between the two becomes a health check. Then I would write down a policy: which data classes need exactness, how long they are kept, what audit and privacy controls apply, and which systems are approved for each, so the next product idea is answered by the policy.
And I would be honest with leadership about the cost of a second pipeline, a few engineer-months and a run cost, and put next to it the revenue and trust lost if customers find billing errors we cannot reproduce.
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 official documentation for the version you use. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
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 do you decide where billing-grade usage data should live, and what principles do you...": https://scrivio-interview-library.netlify.app/architecture/storage-and-pipelines/e9a4aac488/