Cosmos DB APIs & Capacity
APIs · Provisioned · Autoscale · Serverless · Multi-region
Practice questions for this topic →
APIs
| API | Pick when… |
|---|---|
| NoSQL | New apps; richest features; native JSON |
| MongoDB | Existing MongoDB apps and drivers |
| Apache Cassandra | Existing Cassandra/CQL apps |
| Apache Gremlin | Graph relationships |
| Table | Table Storage apps needing global distribution and indexing |
Capacity modes
| Mode | Billing | Regions | Latency target | Pick when… |
|---|---|---|---|---|
| Provisioned (manual) | RU/s per hour | Unlimited | <10 ms point reads and writes (SLA) | Steady, predictable traffic |
| Autoscale | Highest RU/s reached in each hour (scales 10%–100% of the maximum) | Unlimited | As provisioned | Variable traffic with an SLA |
| Serverless | RUs consumed | Single region only | <10 ms point reads, <30 ms writes (SLO) | Intermittent, low average traffic, dev/test |
Facts to know
- Serverless → provisioned is a one-way conversion. Each container becomes manual throughput of partitions × 5,000 RU/s; you can then switch it to autoscale.
- Microsoft's example: a workload peaking at 500 RU/s that consumes 20 million RUs a month costs about $29.20 provisioned and about $5 serverless.
- Gremlin and Table accounts use the default consistency level configured on the account.
- Synapse Link for Cosmos DB is no longer supported for new projects; use Cosmos DB mirroring in Microsoft Fabric.
Exam Tips
Tick each tip once you can answer it without looking.
“Existing MongoDB app moved to Azure with no code changes” → Cosmos DB for MongoDB.
“Model social network relationships” → Cosmos DB for Apache Gremlin.
“Sporadic traffic, lowest cost, single region” → Serverless.
“Unpredictable spikes but must keep SLA and multiple regions” → Autoscale provisioned throughput. Trap: Serverless is single-region only.
“Writes must be accepted in every region with lowest latency” → Multi-region writes (multi-master).
“Steady 10,000 RU/s around the clock” → Manual provisioned throughput (+ reserved capacity).
“Replicate Cosmos data to analytics without impacting transactions (new project)” → Cosmos DB mirroring in Microsoft Fabric. Trap: Synapse Link isn't supported for new projects.
“Convert a serverless account to provisioned throughput” → Each container gets partitions x 5,000 RU/s as manual throughput, and the change is irreversible. Trap: You can move to autoscale afterwards.
“Latency guarantees by capacity mode” → Provisioned: under 10 ms point reads and writes (SLA). Serverless: under 10 ms reads and under 30 ms writes (SLO). Trap: Serverless accounts run in one region only.