Understand your Azure Cosmos DB bill

APPLIES TO: NoSQL MongoDB APPLIES TO: Cassandra APPLIES TO: Gremlin APPLIES TO: Table

As a fully managed cloud-native database service, Azure Cosmos DB simplifies billing by charging only for your database operations and consumed storage. There are no additional license fees, hardware, utility costs, or facility costs compared to on-premises or IaaS-hosted alternatives. When you consider the multi region capabilities of Azure Cosmos DB, the database service provides a substantial reduction in costs compared to existing on-premises or IaaS solutions.

  • Database operations: The way you get charged for your database operations depends on the type of Azure Cosmos DB account you are using.

    • Provisioned Throughput: You are billed hourly for the maximum provisioned throughput for a given hour, in increments of 100 RU/s.
    • Serverless: You are billed hourly for the total amount of Request Units consumed by your database operations.
  • Storage: You are billed a flat rate for the total amount of storage (in GBs) consumed by your data and indexes for a given hour.

See the pricing page for the latest pricing information.

This article uses some examples to help you understand the details you see on the monthly bill. The numbers shown in the examples may be different if your Azure Cosmos DB containers have a different amount of throughput provisioned, if they span across multiple regions or run for a different for a period over a month. All the examples in this article calculate the bill based on the pricing information shown in the Pricing page.

Note

Billing is for any portion of a wall-clock hour, not a 60 minute duration. The pricing and calculation vary depending on the region you are using, see the Azure Cosmos DB pricing page for latest pricing information.

Billing examples

Billing example - provisioned throughput on a container (full month)

  • Let's assume you configure a throughput of 1,000 RU/sec on a container, and it exists for 24 hours * 31 days for the month = 744 hours total.

  • 1,000 RU/sec is 10 units of 100 RU/sec per hour for each hour the containers exists (that is, 1,000/100 = 10).

  • Multiplying 10 units per hour by the cost of CNY0.051 (per 100 RU/sec per hour) = CNY0.51 per hour.

  • Multiplying the CNY0.51 per hour by the number of hours in the month equals CNY0.51 * 24 hours * 31 days = CNY610.1 for the month.

  • The total monthly bill will show 7,440 units (of 100 RUs), which will cost CNY610.1.

Billing example - provisioned throughput on a container (partial month)

  • Let's assume we create a container with provisioned throughput of 2,500 RU/sec. The container lives for 24 hours over the month (for example, we delete it 24 hours after we create it).

  • Then we'll see 600 units on the bill (2,500 RU/sec / 100 RU/sec/unit * 24 hours). The cost will be CNY30.6 (600 units * CNY0.051/unit).

  • Total bill for the month will be CNY30.6.

Billing example - serverless container

  • Let's assume we create a serverless container.

  • Over a month, we issue database requests consuming a total of 500,000 Request Units. The cost will be CNY1.18 (500,000 * CNY2.36/million).

  • Total bill for the month will be CNY1.18.

Billing rate if storage size changes

Storage capacity is billed in units of the maximum hourly amount of data stored, in GB, over a monthly period. For example, if you utilized 100 GB of storage for half of the month and 50 GB for the second half of the month, you would be billed for an equivalent of 75 GB of storage during that month.

Billing rate when container or a set of containers are active for less than an hour

You're billed the flat rate for each hour the container or database exists, no matter the usage or if the container or database is active for less than an hour. For example, if you create a container or database and delete it 5 minutes later, your bill will include one hour.

Billing rate when provisioned throughput on a container or database scales up/down

If you increase provisioned throughput at 9:30 AM from 400 RU/sec to 1,000 RU/sec and then lower provisioned throughput at 10:45 AM back to 400 RU/sec, you will be charged for two hours of 1,000 RU/sec.

If you increase provisioned throughput for a container or a set of containers at 9:30 AM from 100-K RU/sec to 200-K RU/sec and then lower provisioned throughput at 10:45 AM back to 100-K RU/sec, you'll be charged for two hours of 200 K RU/sec.

Billing example: multiple containers, each with dedicated provisioned throughput mode

  • If you create an Azure Cosmos DB account in China East 2 with two containers with provisioned throughput of 500 RU/sec and 700 RU/sec, respectively, you would have a total provisioned throughput of 1,200 RU/sec.

  • You would be charged 1,200/100 *�CNY0.051�=�CNY0.612/hour.

  • If your throughput needs changed, and you've increased each container's capacity by 500 RU/sec while also creating a new unlimited container with 20,000 RU/sec, your overall provisioned capacity would be 22,200 RU/sec (1,000 RU/sec + 1,200 RU/sec + 20,000RU/sec).

  • Your bill would then change to:�CNY0.051�x 222 =�CNY11.322/hour.

  • In a month of 744 hours (24 hours * 31 days), if for 500 hours provisioned throughput was 1,200 RU/sec and for the remaining 244 hours provisioned throughput was 22,200 RU/sec, your monthly bill shows: 500 x�CNY0.612/hour + 244 x�CNY11.322/hour =�CNY3068.57/month.

Billing example: containers with shared (provisioned) throughput mode

  • If you create an Azure Cosmos DB account in China East 2 with two Azure Cosmos databases (with a set of containers sharing the throughput at the database level) with the provisioned throughput of 50-K RU/sec and 70-K RU/sec, respectively, you would have a total provisioned throughput of 120 K RU/sec.

  • You would be charged 1200 x�CNY0.051�=�CNY61.2/hour.

  • If your throughput needs changed and you increased each database's provisioned throughput by 10K RU/sec for each database, and you add a new container to the first database with dedicated throughput mode of 15-K RU/sec to your shared throughput database, your overall provisioned capacity would be 155-K RU/sec (60 K RU/sec + 80 K RU/sec + 15 K RU/sec).

  • Your bill would then change to: 1,550 *�CNY0.051�=�CNY79.05/hour.

  • In a month of 744 hours, if for 300 hours provisioned throughput was 120-K RU/sec and for the remaining 444 hours provisioned throughput was 155-K RU/sec, your monthly bill will show: 300 x�CNY61.2/hour + 444 x�CNY79.05/hour =�CNY18,360�+�CNY35,098.2�=�CNY53,458.2/month.

Billing examples with geo-replication

You can add/remove Azure regions anywhere in China to your Azure Cosmos database account at any time. The throughput that you have configured for various Azure Cosmos databases and containers will be reserved in each of the Azure regions associated with your Azure Cosmos database account. If the sum of provisioned throughput (RU/sec) configured across all the databases and containers within your Azure Cosmos database account (provisioned per hour) is T and the number of Azure regions associated with your database account is N, then the total provisioned throughput for a given hour, for your Azure Cosmos database account is equal to T x N RU/sec. Provisioned throughput (single write region) costs CNY0.051/hour per 100 RU/sec and provisioned throughput with multiple writable regions (multi-region writes config) costs CNY0.102/per hour per 100 RU/sec (see the Pricing page). Whether its single write region, or multiple write regions, Azure Cosmos DB allows you to read data from any region.

Billing example: multi-region Azure Cosmos DB account, single region writes

Let's assume you have an Azure Cosmos container in China North. The container is created with throughput 10K RU/sec and you store 1 TB of data this month. Let's assume you add three regions (China East, China North 2, and China East 2) to your Azure Cosmos DB account, each with the same storage and throughput. Your total monthly bill will be (assuming 31 days in a month). Your bill would be as follows:

Item Usage (month) Rate Monthly Cost
Throughput bill for container in China North 10K RU/sec * 24 * 31 CNY0.051�per 100 RU/sec per hour CNY3,794.4
Throughput bill for 3 additional regions - China East, China North 2, and China East 2 3 * 10K RU/sec * 24 * 31 CNY0.051�per 100 RU/sec per hour CNY11,383.2
Storage bill for container in China North 250 GB CNY2.576/GB CNY644
Storage bill for 3 additional regions - China East, China North 2, and China East 2 3 * 250 GB CNY2.576/GB CNY1,932
Total CNY17,753.6

Let's also assume that you egress 100 GB of data every month from the container in China North to replicate data into China East, China North 2, and China East 2. You're billed for egress as per data transfer rates.

Billing example: multi-region Azure Cosmos DB account, multi region writes

Let's assume you create an Azure Cosmos container in China North. The container is created with throughput 10K RU/sec and you store 1 TB of data this month. Let's assume you add three regions (China East, China North 2, and China East 2), each with the same storage and throughput and you want the ability to write to the containers in all regions associated with your Azure Cosmos DB account. Your total monthly bill will be (assuming 31 days in a month) as follows:

Item Usage (month) Rate Monthly Cost
Throughput bill for container in China North (all regions are writable) 10K RU/sec * 24 * 31 CNY0.102�per 100 RU/sec per hour CNY7589
Throughput bill for 3 additional regions - China East, China North 2, and China East 2 (all regions are writable) 3 * 10K RU/sec * 24 * 31 CNY0.102�per 100 RU/sec per hour CNY22,766.4
Storage bill for container in China North 250 GB CNY2.576/GB CNY644
Storage bill for 3 additional regions - China East, China North 2, and China East 2 3 * 250 GB CNY2.576/GB CNY1,932
Total CNY32,931.4

Let's also assume that you egress 100 GB of data every month from the container in China North to replicate data into China East, China North 2, and China East 2. You're billed for egress as per data transfer rates.

Billing example: Azure Cosmos DB account with multi-region writes, database-level throughput including dedicated throughput mode for some containers

Let's consider the following example, where we have a multi-region Azure Cosmos DB account where all regions are writable (multiple write regions config). For simplicity, we will assume storage size stays constant and doesn't change and omit it here to keep the example simpler. The provisioned throughput during the month varied as follows (assuming 31 days or 744 hours):

[0-100 hours]:

  • We created a three region Azure Cosmos DB account (China North, China East, China North 2), where all regions are writable

  • We created a database (D1) with shared throughput 10K RU/sec

  • We created a database (D2) with shared throughput 30-K RU/sec and

  • We created a container (C1) with dedicated throughput 20 K RU/sec

[101-200 hours]:

  • We scaled up database (D1) to 50 K RU/sec

  • We scaled up database (D2) to 70 K RU/sec

  • We deleted container (C1)

[201-300 hours]:

  • We created container (C1) again with dedicated throughput 20 K RU/sec

[301-400 hours]:

  • We removed one of the regions from Azure Cosmos DB account (# of writable regions is now 2)

  • We scaled down database (D1) to 10K RU/sec

  • We scaled up database (D2) to 80 K RU/sec

  • We deleted container (C1) again

[401-500 hours]:

  • We scaled down database (D2) to 10K RU/sec

  • We created container (C1) again with dedicated throughput 20 K RU/sec

[501-700 hours]:

  • We scaled up database (D1) to 20 K RU/sec

  • We scaled up database (D2) to 100 K RU/sec

  • We deleted container (C1) again

[701-744 hours]:

  • We scaled down database (D2) to 50 K RU/sec

Visually the changes in total provisioned throughput during 744 hours for the month are shown in the figure below:

Real life example

The total monthly bill will be (assuming 31 days/744 hours in a month) will be computed as follows:

Hours RU/s Item Usage (hourly) Cost
[0-100] D1:10K
D2:30K
C1:20K
Throughput bill for container in China North (all regions are writable) D1: 10K RU/sec/100 * CNY0.102 * 100 hours = CNY1,020
D2: 30 K RU/sec/100 * CNY0.102 * 100 hours = CNY3,060
C1: 20 K RU/sec/100 *CNY0.102 * 100 hours = CNY2,040
CNY6,120
Throughput bill for 2 additional regions: China East, China North 2 (all regions are writable) (2 + 1) * (60 K RU/sec /100 * CNY0.102) * 100 hours = CNY18,360 CNY18,360
[101-200] D1:50K
D2:70K
C1: --
Throughput bill for container in China North (all regions are writable) D1: 50 K RU/sec/100 * CNY0.102 * 100 hours = CNY5,100
D2: 70 K RU/sec/100 * CNY0.102 * 100 hours = CNY7,140
CNY12,240
Throughput bill for 2 additional regions: China East, China North 2 (all regions are writable) (2 + 1) * (120 K RU/sec /100 * CNY0.102) * 100 hours = CNY36,720 CNY36,720
[201-300] D1:50K
D2:70K
C1:20K
Throughput bill for container in China North (all regions are writable) D1: 50 K RU/sec/100 * CNY0.102 * 100 hours = CNY5,100
D2: 70 K RU/sec/100 * CNY0.102 * 100 hours = CNY7,140
C1: 20 K RU/sec/100 *CNY0.102 * 100 hours = CNY2,040
CNY14,280
Throughput bill for 2 additional regions: China East, China North 2 (all regions are writable) (2 + 1) * (140 K RU/sec /100 * CNY0.102) * 100 hours = CNY42,840 CNY42,840
[301-400] D1:10K
D2:80K
C1: --
Throughput bill for container in China North (all regions are writable) D1: 10K RU/sec/100 * CNY0.102 * 100 hours = CNY1,020
D2: 80 K RU/sec/100 * CNY0.102 * 100 hours = CNY8,160
CNY9,180
Throughput bill for 2 additional regions: China East, China North 2 (all regions are writable) (1 + 1) * (90 K RU/sec /100 * CNY0.102) * 100 hours = CNY18,360 CNY18,360
[401-500] D1:10K
D2:10K
C1:20K
Throughput bill for container in China North (all regions are writable) D1: 10K RU/sec/100 * CNY0.102 * 100 hours = CNY1,020
D2: 10K RU/sec/100 * CNY0.102 * 100 hours = CNY1,020
C1: 20 K RU/sec/100 *CNY0.102 * 100 hours = CNY2,040
CNY4,080
Throughput bill for 2 additional regions: China East, China North 2 (all regions are writable) (1 + 1) * (40 K RU/sec /100 * CNY0.102) * 100 hours = CNY8,160 CNY8,160
[501-700] D1:20K
D2:100K
C1: --
Throughput bill for container in China North (all regions are writable) D1: 20 K RU/sec/100 * CNY0.102 * 200 hours = CNY4,080
D2: 100 K RU/sec/100 * CNY0.102 * 200 hours = CNY20,400
CNY24,480
Throughput bill for 2 additional regions: China East, China North 2 (all regions are writable) (1 + 1) * (120 K RU/sec /100 * CNY0.102) * 200 hours = CNY8,160 CNY8,160
[701-744] D1:20K
D2:50K
C1: --
Throughput bill for container in China North (all regions are writable) D1: 20 K RU/sec/100 *CNY0.102 * 44 hours = CNY896.7
D2: 50 K RU/sec/100 *CNY0.102 * 44 hours = CNY2,244
CNY3140.7
Throughput bill for 2 additional regions: China East, China North 2 (all regions are writable) (1 + 1) * (70 K RU/sec /100 * CNY0.102) * 44 hours = CNY6,283.2 CNY6,283.2
Total Monthly Cost CNY212,403.9

Billing examples with Azure Cosmos DB free tier accounts

With Azure Cosmos DB free tier, you'll get the first 1000 RU/s and 25 GB of storage in your account for free, applied at the account level. Any RU/s and storage beyond 1000 RU/s and 25 GB will be billed at the regular pricing rates per the pricing page. On the bill, you will not see a charge or line item for the free 1000 RU/s and 25 GB, only the RU/s and storage beyond what is covered by free tier. To learn more, see how to create a free tier account article.

Billing example - container or database with provisioned throughput

  • Let's suppose we create a database or container in a free tier account with 1000 RU/s and 25 GB of storage.
  • Your bill will not show any charge for this resource. Your hourly and monthly cost will be $0.
  • Now, let's suppose in the same account, we add another database or container with 400 RU/s and 10 GB of storage.
  • Your bill will now show a charge for the 400 RU/s and 10 GB of storage.

Billing example - container with autoscale throughput

Tip

When using autoscale, the entry point scale range you can set is 100 - 1000 RU/s. If you want to use autoscale and keep your free tier account completely free, create either one container with this scale range, or a shared throughput database with up to 25 containers inside. The example below illustrates how billing works if you provision throughput higher than the 100 - 1000 RU/s scale range.

  • Let's suppose in a free tier account, we create a container with autoscale enabled, with a maximum RU/s of 4000 RU/s. This resource will automatically scale between 400 RU/s - 4000 RU/s.
  • Suppose in hour 1 through hour 10, the resource is scaled to 1000 RU/s. During hour 11, the resource scales up to 1600 RU/s and then back down to 1000 RU/s within the hour.
  • In hours 1 through 10, you will be billed CNY0 for throughput, as the 1000 RU/s were covered by free tier.
  • In hour 11, you will be billed for an effective 1600 RU/s - 1000 RU/s = 600 RU/s, as this is the highest RU/s in the hour. This will be 6 units of 100 RU/s for the hour, so the total throughput cost for the hour will be 6 units * CNY0.123 = CNY0.738.
  • Any storage beyond the first 25 GB will be billed at normal storage rates.

Billing example - multi-region, single write region account

  • Let's suppose in a free tier account, we create a database or container with 1200 RU/s and 10 GB of storage. We replicate the account to 3 regions, and we have a single write-region account.
  • In total, without free tier, we would be billed for 3 * 1200 RU/s = 3600 RU/s and 3 * 10 GB = 30 GB of storage.
  • With the free tier discount, after removing 1000 RU/s and 25 GB of storage, we will be billed for an effective 2600 RU/s (26 units) of provisioned throughput at the single write region rate and 5 GB of storage.
  • The monthly cost for RU/s would be: 26 units * CNY0.051 * 24 hours * 31 days = CNY986.55 . The monthly cost for storage would be: 5 GB * 2.576 / GB = CNY12.88 . The total cost would be CNY986.55 + CNY12.88 = CNY999.43 .

Note

If the unit price for RU/s or storage differs in the regions, the free tier 1000 RU/s and 25 GB will reflect the rates of the region the account was created in.

Billing example - multi-region, account with multiple write regions

This example reflects pricing for multi-region writes for accounts created after December 1, 2019.

  • Let's suppose in a free tier account, we create a database or container with 1200 RU/s and 10 GB of storage. We replicate the account to 3 regions, and we have a multiple write regions account.
  • In total, without free tier, we would be billed for 3 * 1200 RU/s = 3600 RU/s and 3 * 10 GB = 30 GB of storage.
  • With the free tier discount, after removing 1000 RU/s and 25 GB of storage, we will be billed for an effective 2600 RU/s (26 units) of provisioned throughput at the multiple write region rate and 5 GB of storage.
  • The monthly cost for RU/s would be: 26 units * CNY0.102 * 24 hours * 31 days = CNY1,973.09. The monthly cost for storage would be: 5 GB * 2.576 / GB = CNY12.88 . The total cost would be CNY1,973.09 + CNY12.88 = CNY1,985.97.

Proactively estimating your monthly bill

Let's consider another example, where you want to proactively estimate your bill before the month's end. You can estimate your bill as follows:

Storage cost

  • Avg Record Size (KB) = 1
  • Number of Records = 100,000,000
  • Total Storage (GB) = 100
  • Monthly cost per GB = CNY2.576
  • Expected Monthly Cost for Storage = CNY257.6

Throughput Cost

Operation type Requests/sec Avg. RU/request RUs needed
Write 100 5 500
Read 400 1 400

Total RU/sec: 500 + 400 = 900 Hourly cost: 900/100 * CNY0.051 = CNY0.459 Expected Monthly Cost for Throughput (assuming 31 days): CNY0.459 * 24 * 31 = CNY341.50

Total Monthly Cost

Total Monthly Cost = Monthly Cost for Storage + Monthly Cost for Throughput Total Monthly Cost = CNY257.6 + CNY341.50 = CNY599.1

Pricing may vary by region. For up-to-date pricing, see the Pricing page.

Next Steps

Next you can proceed to learn about cost optimization in Azure Cosmos DB with the following articles: