Azure CosmosDB throughput (RU)

Lets start with a quote from microsoft what throughput actually is:

The cost of all database operations is normalized by Azure Cosmos DB and is expressed by Request Units (or RUs, for short). You can think of RUs per second as the currency for throughput. RUs per second is a rate-based currency. It abstracts the system resources such as CPU, IOPS, and memory that are required to perform the database operations supported by Azure Cosmos DB.

You can start with a minimum throughput of 400 RU/sec and scale up to tens of millions of requests per second or even more. Each request you issue against your Azure Cosmos container or database, such as a read request, write request, query request, stored procedures have a corresponding cost that is deducted from your provisioned throughput. If you provision 400 RU/s and issue a query that costs 40 RUs, you will be able to issue 10 such queries per second.

Throughput can be set on several resources

  • database
  • container (shared/dedicated)

In this example I am using MongoDB. I've created a database and 2 collections (containers). The database itself doesn't produce any costs.

The database was created with 500 RU, these will be shared through all collections added to the database.

As you can see all databases belong to one db. The difference is that shared and shared2 share the same 400RU.

You can change this behaviour by creating collection with dedicated throughput.



This is how dedicated was created.

Relevant to read:

https://docs.microsoft.com/en-us/azure/cosmos-db/request-units

https://docs.microsoft.com/en-us/azure/cosmos-db/how-to-provision-database-throughput

https://docs.microsoft.com/en-us/azure/cosmos-db/optimize-cost-throughput