Skip to content

Commit 18633c3

Browse files
committed
Edit request units
1 parent f4f1b7c commit 18633c3

File tree

1 file changed

+24
-32
lines changed

1 file changed

+24
-32
lines changed

articles/cosmos-db/request-units.md

Lines changed: 24 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,46 @@
11
---
2-
title: Request Units as a throughput and performance currency in Azure Cosmos DB
3-
description: Learn about how to specify and estimate Request Unit requirements in Azure Cosmos DB
2+
title: Request Units as a throughput and performance currency
3+
titleSuffix: Azure Cosmos DB
4+
description: Learn how request units function as a currency in Azure Cosmos DB and how to specify and estimate Request Unit requirements.
45
author: seesharprun
56
ms.author: sidandrews
67
ms.reviewer: mjbrown
78
ms.service: cosmos-db
89
ms.topic: conceptual
9-
ms.date: 03/24/2022
10+
ms.date: 02/27/2023
1011
ms.custom: seo-nov-2020, cosmos-db-video, ignite-2022
1112
---
13+
1214
# Request Units in Azure Cosmos DB
15+
1316
[!INCLUDE[NoSQL, MongoDB, Cassandra, Gremlin, Table](includes/appliesto-nosql-mongodb-cassandra-gremlin-table.md)]
1417

1518
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.
1619

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.
1821

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.
2023

21-
>
22-
> [!VIDEO https://aka.ms/docs.essential-request-units]
24+
> [!VIDEO https://learn.microsoft.com/_themes/docs.theme/master/en-us/_themes/global/video-embed.html?id=772fba63-62c7-488c-acdb-a8f686a3b5f4]
2325
2426
The following image shows the high-level idea of RUs:
2527

2628
:::image type="content" source="./media/request-units/request-units.png" alt-text="Database operations consume Request Units" border="false":::
2729

28-
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.
2931

3032
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:
3133

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.
3335

34-
You can provision throughput at two distinct granularities:
36+
You can assign throughput at two distinct granularities:
3537

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).
3840

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.
4042

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.
4244

4345
## Request Unit considerations
4446

@@ -54,10 +56,10 @@ While you estimate the number of RUs consumed by your workload, consider the fol
5456

5557
* **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.
5658

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:
5862

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-
6163
* The number of query results
6264
* The number of predicates
6365
* The nature of the predicates
@@ -66,30 +68,20 @@ While you estimate the number of RUs consumed by your workload, consider the fol
6668
* The size of the result set
6769
* Projections
6870

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.
7072

7173
* **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.
7274

7375
## Request units and multiple regions
7476

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.
7678

7779
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*.
7880

7981
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).
8082

8183
## Next steps
8284

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

Comments
 (0)