In Azure Cosmos DB, Request Units (RUs) are the currency for throughput. Every operation - whether it's a read, write, query, or stored procedures - consumes a certain number of RUs based on its complexity. This abstraction simplifies performance management across APIs (SQL, MongoDB, Cassandra, Gremlin, Table) by providing a unified metric.
RU Consumption Basics
- Read operations typically consume fewer RUs than writes.
- Query complexity (filters, joins, projections) directly affects RU usage.
- Document size and indexing also influence RU cost.
- Consistency level (e.g., strong vs. eventual) can impact RU consumption.
Microsoft provides a Request Unit calculator to estimate RU needs based on operation type and data size.
Watch the below video to understand more about Request Units in Azure Cosmos DB.
Throughput Models
Cosmos DB offers two main throughput provisioning models:
1. Standard (Manual) Provisioned Throughput
- You allocate a fixed RU/s to a container or database.
- Ideal for predictable workloads.
- Can be scaled manually or programmatically.
2. Autoscale Throughput
- Automatically adjusts RU/s between a defined minimum and maximum.
- Great for variable workloads.
- Helps avoid over-provisioning and under-utilization.
Autoscale is especially useful for applications with unpredictable traffic patterns, such as e-commerce or IoT platforms.
Follow the Microsoft guidance in the article Best practices for scaling Throughput RUs to determine the number of physical partitions.
Microsoft Documentation Links:
Limit the total throughput provisioned on your Azure Cosmos DB account | Microsoft Learn
Find request unit charge for a SQL query in Azure Cosmos DB | Microsoft Learn
Burst capacity - Azure Cosmos DB | Microsoft Learn
Choose between
How to choose between manual and autoscale on Azure Cosmos DB | Microsoft Learn
How to choose between provisioned throughput and serverless on Azure Cosmos DB | Microsoft Learn
Best Practices
Best practices for scaling provisioned throughput (RU/s) | Microsoft Learn
Preview Features
Merge partitions (preview) - Azure Cosmos DB | Microsoft Learn
Redistribute throughput across partitions (preview) in Azure Cosmos DB | Microsoft Learn - check out if you want throughput control at hot partitions.
Priority-based execution (preview) - Azure Cosmos DB | Microsoft Learn
Azure Cosmos DB: Throughput buckets (preview) | Microsoft Learn - try it if you want to see which workload needs which bucket.
Comments
Post a Comment