Azure Cosmos DB serverless cost: pay per request unit consumed
Cosmos DB serverless bills per request unit (RU) consumed plus storage, with no provisioned throughput to pay for when idle. It suits spiky or low-traffic workloads; steady high traffic is cheaper on provisioned throughput. Here is how to choose.
Quick answer
Cosmos DB serverless bills only for the request units (RUs) you consume (around $0.25 per million RUs) plus storage, with nothing to pay when idle. It suits spiky, low-traffic, or unpredictable workloads. For steady, high-throughput workloads, provisioned throughput (especially autoscale or reserved) is cheaper per request. Match the mode to your traffic shape.
Cosmos DB offers two billing models, and picking the wrong one is the most common Cosmos overspend. Serverless charges purely for consumed request units; provisioned throughput reserves RU capacity by the hour. The decision is the familiar spiky-versus-steady tradeoff.
Serverless: pay per RU
In serverless mode you pay about $0.25 per million request units actually consumed, plus storage, with no reserved capacity. An idle database costs only storage, and a bursty one costs in proportion to its requests. There is no throughput to size and no idle capacity to pay for.
Serverless vs provisioned
| Mode | Bills for | Best when |
|---|---|---|
| Serverless | RUs consumed + storage | Spiky, low, or unpredictable traffic |
| Provisioned (manual) | Reserved RU/s, hourly | Steady, predictable high traffic |
| Provisioned (autoscale) | RU/s up to a max, hourly | Variable but sustained traffic |
Provisioned throughput reserves RU/s and is cheaper per request at steady, high volume, and reserved-capacity discounts lower it further. Autoscale provisioned throughput is a middle ground that scales RU/s within a band. The same logic as optimizing Cosmos RU cost applies: match the mode to the traffic.
Controlling serverless cost
Because you pay per RU, the levers are query efficiency and data model: index only what you query, avoid cross-partition scans, and use point reads where possible, all of which lower RU consumption per operation. Cache hot reads to deflect RUs entirely, the caching lever. And if a serverless workload grows into steady high traffic, re-evaluate against provisioned throughput, since the crossover moves as volume rises.
FAQ
How is Cosmos DB serverless priced?
Per request unit consumed, around $0.25 per million RUs, plus storage, with no reserved throughput to pay for when idle. An idle database costs only storage, and a busy one costs in proportion to the RUs its operations consume.
Is Cosmos serverless cheaper than provisioned?
For spiky, low, or unpredictable traffic, yes, because you avoid paying for reserved throughput that sits idle. For steady, high-throughput workloads, provisioned throughput (especially autoscale or reserved) is cheaper per request. Match the mode to your traffic shape.
What is a request unit in Cosmos DB?
The normalized unit of throughput cost. Every operation consumes RUs based on its complexity, item size, and indexing, so a point read costs few RUs and a cross-partition query costs many. In serverless mode you pay per RU consumed.
How do I reduce Cosmos serverless cost?
Lower RU consumption per operation: index only what you query, avoid cross-partition scans, use point reads where possible, and cache hot reads to deflect RUs. If a serverless workload grows into steady high traffic, compare against provisioned throughput.
When should I switch from serverless to provisioned?
When traffic becomes steady and high enough that reserved RU/s cost less than the per-RU serverless charge for the same volume. As traffic grows the crossover favors provisioned, and reserved-capacity discounts lower provisioned cost further.
Does C3X estimate Cosmos DB cost?
C3X prices the azurerm_cosmosdb_account and its throughput configuration from your Terraform, so provisioned throughput cost appears before deploy. For serverless, RU consumption is a usage input you model, since it depends on query volume and efficiency.
What to do next
Compare serverless and provisioned before you choose. C3X reads your Terraform and prices Cosmos DB and the rest of your stack against a live catalog. Start with the quickstart.
Pricing references
Related posts
- Azure Cosmos DB autoscale cost: when the 50% premium pays off
Cosmos DB autoscale raises the per-RU/s rate by 50 percent but scales throughput automatically between 10 percent and 100 percent of a maximum. For variable traffic it can be cheaper than standard provisioned; for flat traffic it is a needless premium. Here is the math.
- Azure Cosmos DB RU cost optimization: stop over-provisioning throughput
Cosmos DB bills by provisioned RU/s (~$0.008 per 100 RU/s-hour) times region count. Over-provisioned throughput and needless multi-region writes are the big overspends. Here's how to right-size and which throughput model to pick.
- Azure Cosmos DB multi-region cost: what each replica region adds
Adding a region to Cosmos DB multiplies your throughput cost by the number of regions, and enabling multi-region writes multiplies it further. Global distribution is powerful but priced per region. Here is how to weigh the cost against the benefit.
- Serverless database vs provisioned cost: pay per use or reserve capacity?
Serverless databases scale capacity automatically and bill per use, costing nothing when idle; provisioned databases reserve fixed capacity at a flat rate. The crossover is utilization, and it decides which is cheaper. Here is the math with numbers.
Share this post
Try C3X on your own Terraform
Free and open source. No API key required. One command to install, one command to estimate.