Design Request Unit Budgets for a Multi-Tenant Cosmos DB Style Store
Last updated: November 29, 2026
Quick Overview
Design how a multi-tenant NoSQL database charges each operation in request units, enforces each container's provisioned throughput across its physical partitions, and supports autoscale.
Microsoft
November 29, 20260
0
0 solved
Design how a multi-tenant NoSQL database charges each operation in request units, enforces each container's provisioned throughput across its physical partitions, and supports autoscale.
Cosmos DB uses request units to make throughput predictable for customers, and the Azure Data team uses this question to probe resource governance inside a database rather than at the edge. The interviewer looks for per-partition budgets, cost estimation and fairness between co-located tenants.
What the Interviewer Expects
- Defines a request unit cost model based on CPU, IO and memory of each operation
- Splits a container's provisioned throughput evenly across physical partitions and explains hot partition problems
- Enforces budgets per partition replica with per-second buckets
- Isolates tenants sharing a machine
- Implements autoscale between a min and max with billing per hour at peak
- Explains client-visible behavior on throttling
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 container has 10,000 RU/s across 5 partitions, but 80 percent of traffic hits one key. What does the customer see?
- How do you charge a query before you know how many documents it reads?
- How does autoscale decide to scale and how is it billed?
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
Customers provision throughput in RU/s per container (or database). A point read of 1 KB is 1 RU; writes and queries cost more. Requests above the budget get 429 with a retry hint. Latency single-digi...
High-Level Design
A container is split into physical partitions by hashing the partition key; each partition is a replica set placed on machines in a cluster. Each partition receives budget = provisioned RU/s / partiti...