How to choose between provisioned throughput and serverless

APPLIES TO: SQL API Cassandra API Gremlin API Table API Azure Cosmos DB API for MongoDB

Azure Cosmos DB is available in two different capacity modes: provisioned throughput and serverless. You can perform the exact same database operations in both modes, but the way you get billed for these operations is radically different. The following video explains the core differences between these modes and how they fit different types of workloads:

Detailed comparison

Criteria Provisioned throughput Serverless
Best suited for Workloads with sustained traffic requiring predictable performance Workloads with intermittent or unpredictable traffic and low average-to-peak traffic ratio
How it works For each of your containers, you provision some amount of throughput expressed in Request Units per second. Every second, this amount of Request Units is available for your database operations. Provisioned throughput can be updated manually or adjusted automatically with autoscale. You run your database operations against your containers without having to provision any capacity.
Geo-distribution Available (unlimited number of Azure regions) Unavailable (serverless accounts can only run in 1 Azure region)
Maximum storage per container Unlimited 50 GB
Performance < 10 ms latency for point-reads and writes covered by SLA < 10 ms latency for point-reads and < 30 ms for writes covered by SLO
Billing model Billing is done on a per-hour basis for the RU/s provisioned, regardless of how many RUs were consumed. Billing is done on a per-hour basis for the amount of RUs consumed by your database operations.

Estimating your expected consumption

In some situations, it may be unclear whether provisioned throughput or serverless should be chosen for a given workload. To help with this decision, you can estimate your overall expected consumption, that is what's the total number of RUs you may consume over a month (you can estimate this with the help of the table shown here)

Example 1: a workload is expected to burst to a maximum of 500 RU/s and consume a total of 20,000,000 RUs over a month.

  • In provisioned throughput mode, you would provision a container with 500 RU/s for a monthly cost of: $0.008 * 5 * 730 = $29.20
  • In serverless mode, you would pay for the consumed RUs: $0.25 * 20 = $5.00

Example 2: a workload is expected to burst to a maximum of 500 RU/s and consume a total of 250,000,000 RUs over a month.

  • In provisioned throughput mode, you would provision a container with 500 RU/s for a monthly cost of: $0.008 * 5 * 730 = $29.20
  • In serverless mode, you would pay for the consumed RUs: $0.25 * 250 = $62.50

(these examples are not accounting for the storage cost, which is the same between the two modes)

Note

The costs shown in the previous example are for demonstration purposes only. See the pricing page for the latest pricing information.

Next steps