You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Azure Cosmos DB supports many APIs, such as SQL, MongoDB, Cassandra, Gremlin, and Table. Each API has its own set of database operations. These operations range from simple point reads and writes to complex queries. Each database operation consumes system resources based on the complexity of the operation.
16
19
17
-
The cost of all database operations is normalized by Azure Cosmos DB and is expressed by Request Units (or RUs, for short). Request unit is a performance currency abstracting the system resources such as CPU, IOPS, and memory that are required to perform the database operations supported by Azure Cosmos DB.
20
+
Azure Cosmos DB normalizes the cost of all database operations using Request Units (or RUs, for short). Request unit is a performance currency abstracting the system resources such as CPU, IOPS, and memory that are required to perform the database operations supported by Azure Cosmos DB.
18
21
19
-
The cost to do a point read (fetching a single item by its ID and partition key value) for a 1-KB item is 1 Request Unit (or 1 RU). All other database operations are similarly assigned a cost using RUs. No matter which API you use to interact with your Azure Cosmos DB container, costs are always measured by RUs. Whether the database operation is a write, point read, or query, costs are always measured in RUs.
22
+
The cost to do a point read (fetching a single item by its ID and partition key value) for a 1-KB item is one Request Unit (or one RU). All other database operations are similarly assigned a cost using RUs. No matter which API you use to interact with your Azure Cosmos DB container, RUs measure the actual costs of using that API. Whether the database operation is a write, point read, or query, costs are always measured in RUs.
To manage and plan capacity, Azure Cosmos DB ensures that the number of RUs for a given database operation over a given dataset is deterministic. You can examine the response header to track the number of RUs that are consumed by any database operation. When you understand the [factors that affect RU charges](request-units.md#request-unit-considerations) and your application's throughput requirements, you can run your application cost effectively.
30
+
To manage and plan capacity, Azure Cosmos DB ensures that the number of RUs for a given database operation over a given dataset is deterministic. You can examine the response header to track the number of RUs consumed by any database operation. When you understand the [factors that affect RU charges](request-units.md#request-unit-considerations) and your application's throughput requirements, you can run your application cost effectively.
29
31
30
32
The type of Azure Cosmos DB account you're using determines the way consumed RUs get charged. There are three modes in which you can create an account:
31
33
32
-
1.**Provisioned throughput mode**: In this mode, you provision the number of RUs for your application on a per-second basis in increments of 100 RUs per second. To scale the provisioned throughput for your application, you can increase or decrease the number of RUs at any time in increments or decrements of 100 RUs. You can make your changes either programmatically or by using the Azure portal. You are billed on an hourly basis for the number of RUs per second you have provisioned. To learn more, see the [Provisioned throughput](set-throughput.md) article.
34
+
1.**Provisioned throughput mode**: In this mode, you assign the number of RUs for your application on a per-second basis in increments of 100 RUs per second. To scale the provisioned throughput for your application, you can increase or decrease the number of RUs at any time in increments or decrements of 100 RUs. You can make your changes either programmatically or by using the Azure portal. You're billed on an hourly basis for the number of RUs per second you've provisioned. To learn more, see the [Provisioned throughput](set-throughput.md) article.
33
35
34
-
You can provision throughput at two distinct granularities:
36
+
You can assign throughput at two distinct granularities:
35
37
36
-
***Containers**: For more information, see [Provision throughput on an Azure Cosmos DB container](how-to-provision-container-throughput.md).
37
-
***Databases**: For more information, see [Provision throughput on an Azure Cosmos DB database](how-to-provision-database-throughput.md).
38
+
***Containers**: For more information, see [Assign throughput to an Azure Cosmos DB container](how-to-provision-container-throughput.md).
39
+
***Databases**: For more information, see [Assign throughput to an Azure Cosmos DB database](how-to-provision-database-throughput.md).
38
40
39
-
2.**Serverless mode**: In this mode, you don't have to provision any throughput when creating resources in your Azure Cosmos DB account. At the end of your billing period, you get billed for the number of Request Units that has been consumed by your database operations. To learn more, see the [Serverless throughput](serverless.md) article.
41
+
2.**Serverless mode**: In this mode, you don't have to assign any throughput when creating resources in your Azure Cosmos DB account. At the end of your billing period, you get billed for the number of Request Units consumed by your database operations. To learn more, see the [Serverless throughput](serverless.md) article.
40
42
41
-
3.**Autoscale mode**: In this mode, you can automatically and instantly scale the throughput (RU/s) of your database or container based on its usage, without impacting the availability, latency, throughput, or performance of the workload. This mode is well suited for mission-critical workloads that have variable or unpredictable traffic patterns, and require SLAs on high performance and scale. To learn more, see the [autoscale throughput](provision-throughput-autoscale.md) article.
43
+
3.**Autoscale mode**: In this mode, you can automatically and instantly scale the throughput (RU/s) of your database or container based on its usage. This scaling operation doesn't affect the availability, latency, throughput, or performance of the workload. This mode is well suited for mission-critical workloads that have variable or unpredictable traffic patterns, and require SLAs on high performance and scale. To learn more, see the [autoscale throughput](provision-throughput-autoscale.md) article.
42
44
43
45
## Request Unit considerations
44
46
@@ -54,10 +56,10 @@ While you estimate the number of RUs consumed by your workload, consider the fol
54
56
55
57
***Data consistency**: The strong and bounded staleness consistency levels consume approximately two times more RUs while performing read operations when compared to that of other relaxed consistency levels.
56
58
57
-
***Type of reads**: Point reads cost significantly fewer RUs than queries.
59
+
***Type of reads**: Point reads cost fewer RUs than queries.
60
+
61
+
***Query patterns**: The complexity of a query affects how many RUs are consumed for an operation. Factors that affect the cost of query operations include:
58
62
59
-
***Query patterns**: The complexity of a query affects how many RUs are consumed for an operation. Factors that affect the cost of query operations include:
60
-
61
63
* The number of query results
62
64
* The number of predicates
63
65
* The nature of the predicates
@@ -66,30 +68,20 @@ While you estimate the number of RUs consumed by your workload, consider the fol
66
68
* The size of the result set
67
69
* Projections
68
70
69
-
The same query on the same data will always cost the same number of RUs on repeated executions.
71
+
The same query on the same data always costs the same number of RUs on repeated executions.
70
72
71
73
***Script usage**: As with queries, stored procedures and triggers consume RUs based on the complexity of the operations that are performed. As you develop your application, inspect the [request charge header](./optimize-cost-reads-writes.md#measuring-the-ru-charge-of-a-request) to better understand how much RU capacity each operation consumes.
72
74
73
75
## Request units and multiple regions
74
76
75
-
If you provision*'R'* RUs on an Azure Cosmos DB container (or database), Azure Cosmos DB ensures that *'R'* RUs are available in *each* region associated with your Azure Cosmos DB account. You can't selectively assign RUs to a specific region. The RUs provisioned on an Azure Cosmos DB container (or database) are provisioned in all the regions associated with your Azure Cosmos DB account.
77
+
If you assign*'R'* RUs on an Azure Cosmos DB container (or database), Azure Cosmos DB ensures that *'R'* RUs are available in *each* region associated with your Azure Cosmos DB account. You can't selectively assign RUs to a specific region. The RUs provisioned on an Azure Cosmos DB container (or database) are provisioned in all the regions associated with your Azure Cosmos DB account.
76
78
77
79
Assuming that an Azure Cosmos DB container is configured with *'R'* RUs and there are *'N'* regions associated with the Azure Cosmos DB account, the total RUs available globally on the container = *R* x *N*.
78
80
79
81
Your choice of [consistency model](consistency-levels.md) also affects the throughput. You can get approximately 2x read throughput for the more relaxed consistency levels (*session*, *consistent prefix* and *eventual* consistency) compared to stronger consistency levels (*bounded staleness* or *strong* consistency).
80
82
81
83
## Next steps
82
84
83
-
- Learn more about how to [provision throughput on Azure Cosmos DB containers and databases](set-throughput.md).
84
-
- Learn more about [serverless on Azure Cosmos DB](serverless.md).
85
-
- Learn more about [logical partitions](./partitioning-overview.md).
86
-
- Learn how to [provision throughput on an Azure Cosmos DB container](how-to-provision-container-throughput.md).
87
-
- Learn how to [provision throughput on an Azure Cosmos DB database](how-to-provision-database-throughput.md).
88
-
- Learn how to [find the request unit charge for an operation](find-request-unit-charge.md).
89
-
- Learn how to [optimize provisioned throughput cost in Azure Cosmos DB](optimize-cost-throughput.md).
90
-
- Learn how to [optimize reads and writes cost in Azure Cosmos DB](optimize-cost-reads-writes.md).
91
-
- Learn how to [optimize query cost in Azure Cosmos DB](./optimize-cost-reads-writes.md).
92
-
- Learn how to [use metrics to monitor throughput](use-metrics.md).
93
-
- Trying to do capacity planning for a migration to Azure Cosmos DB?
94
-
- If all you know is the number of vCores and servers in your existing database cluster, read about [estimating request units using vCores or vCPUs](convert-vcore-to-request-unit.md)
95
-
- If you know typical request rates for your current database workload, read about [estimating request units using Azure Cosmos DB capacity planner](estimate-ru-with-capacity-planner.md)
85
+
* Learn more about how to [assign throughput on Azure Cosmos DB containers and databases](set-throughput.md).
86
+
* Learn more about [serverless on Azure Cosmos DB](serverless.md).
87
+
* Learn more about [logical partitions](./partitioning-overview.md)
0 commit comments