Design Azure Usage Metering and the Monthly Billing Pipeline
Last updated: November 29, 2026
Quick Overview
Design how Azure collects resource usage (VM hours, storage GB-months, egress) from every service, rates it against price sheets and discounts, and produces accurate daily cost views and monthly invoices.
Microsoft
November 29, 20260
0
0 solved
Design how Azure collects resource usage (VM hours, storage GB-months, egress) from every service, rates it against price sheets and discounts, and produces accurate daily cost views and monthly invoices.
Billing correctness is a big deal for Azure, and this question tests high-volume event aggregation where every record is money. Interviewers want deduplication, late data handling, idempotent rating, and separation of usage from pricing so price changes can be reapplied.
What the Interviewer Expects
- Defines a common usage record schema that every resource provider emits
- Deduplicates usage with stable record ids
- Aggregates hourly per meter per subscription
- Rates usage separately from collection so prices and discounts can be recomputed
- Handles late and corrected usage before and after invoice close
- Supports daily cost estimates and budgets
Key Topics to Cover
How to Approach This
- Start by clarifying functional and non-functional requirements with the interviewer.
- Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
- Draw a high-level architecture first, then deep dive into 1-2 critical components.
- Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
- Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
- A storage service emits the same usage hour twice after a retry. How is it not billed twice?
- Usage for the 31st arrives on the 3rd after the invoice closed. What happens?
- How do you apply a reservation discount that covers any VM in a region family?
- How would you let customers see cost within a few hours?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice System Design ProblemsSample Answer
Requirements
Hundreds of resource providers, each emitting usage for millions of subscriptions. Granularity: per resource per meter per hour. Daily cost visible to customers within about 8 hours; monthly invoice g...
High-Level Design
- Resource providers emit usage records
{recordId, subscriptionId, resourceId, meterId, quantity, usageStart, usageEnd, emittedAt}to a regional usage ingestion endpoint backed by a durable...