Planning Azure Cosmos DB capacity using vCores, vCPUs, and request rates
New customers who migrate NoSQL databases to Azure Cosmos DB are often unsure of how many throughput request units, or RU/s, to provision for their workload. Determining throughput capacity is an important step – too little and performance suffers; too much and you’ll pay for unused capacity. To avoid these challenges, you can use information about your cluster to estimate request units and avoid overprovisioning or overpaying. Here’s how:
1. Use the Azure Cosmos DB capacity calculator
If you know the typical request rates and request types for the database cluster you already have, then the Azure Cosmos DB capacity calculator is the best tool for capacity planning. View our guides to capacity planning on Azure Cosmos DB Core (SQL) API and API for MongoDB.
2. Use vCores or vCPUs to estimate throughput capacity
Not everyone knows request rate information about their cluster. If you are migrating from an existing database cluster, then you probably know how many data-bearing servers you have and how many vCores or vCPUs are running on your data-bearing servers. That is why we have recently released a guide to estimate RU/s using vCores or vCPU information about your existing cluster. This guide applies to migrations from a sharded and replicated nonrelational database to Azure Cosmos DB Core (SQL) API or API for MongoDB.
Here is an example of how you can estimate RU/s from vCores:
Suppose that you currently have a database cluster consisting of
- A single replica set with a replication factor of 3,
- 12 vCores in total among all data-bearing servers in that replica set
Then depending on which Azure Cosmos DB API you plan to migrate to, a good ballpark estimate of RU/s is
Provisioned RU/s, SQL API = (600 RU/s/vCore) * (12 vCores) / (3 replicas) = 2,400 RU/s
Provisioned RU/s, API for MongoDB = (1,000 RU/s/vCore) * (12 vCores) / (3 replicas) = 4,000 RU/s
- 600 RU/s/vCore is the rough vCores-to-request-units conversion factor for migrations to Azure Cosmos DB SQL API
- 1000 RU/s/vCore is the rough vCores-to-request-units conversion factor for migrations to Azure Cosmos DB API for MongoDB
- A roughly even balance between read and write operations is assumed
About Azure Cosmos DB
Azure Cosmos DB is a fully managed cloud NoSQL database service for modern app development. Get started free.