November 20th, 2025
0 reactions

General Availability: Priority-Based Execution in Azure Cosmos DB

Richa Gaur
Senior Program Manager

Have you ever faced a situation where two different workloads share the same container, and one ends up slowing down the other? This is a common challenge for many of our customers running applications on Azure Cosmos DB.

Imagine these scenarios:

  • A background job consumes most of the throughput, leaving end users frustrated with high latency.
  • Free-tier users hog resources, while your premium customers struggle to access paid services and eventually churn.

In all these cases, there’s one workload you’d prefer to prioritize, ensuring critical operations run smoothly while others can progress slowly during resource contention.

Introducing Priority-Based Execution

Priority-Based Execution solves this problem. It lets you assign high priority to critical workloads and low priority to less important ones using the Azure Cosmos DB SDKs.

When your container hits 100% of its configured throughput, the system starts throttling low-priority requests first, preserving throughput for high-priority operations. This means you can maintain better performance for your key workloads without increasing RU/s, keeping costs under control.

See It in Action

How to enable Priority based execution.

Navigate to the Features tab in your Azure Cosmos DB account and turn on the Priority-Based Execution feature.

A screenshot of a computer AI-generated content may be incorrect.

How to apply priority to requests?

Use PriorityLevel.Low or PriorityLevel.High in your request options:

using Microsoft.Azure.Cosmos;

//update products catalog with low priority
RequestOptions catalogRequestOptions = new ItemRequestOptions{PriorityLevel = PriorityLevel.Low};
PartitionKey pk = new PartitionKey(“productId1”);
ItemResponse<Product> catalogResponse = await this.container.CreateItemAsync<Product>(product1, pk, requestOptions);

//Display product information to user with high priority
RequestOptions getProductRequestOptions = new ItemRequestOptions{PriorityLevel = PriorityLevel.High};
string id = “productId2”;
PartitionKey pk = new PartitionKey(id);
ItemResponse<Product> productResponse = await this.container.ReadItemAsync< Product>(id, pk, getProductRequestOptions);

The default priority level is High. If you don’t specify a priority in the request options, it will automatically be set to High. You can change the default priority level for your Cosmos DB account by following the steps in this guide: Change default priority level.

Important considerations

  • Priority based execution is best effort, it doesn’t guarantee that low priority requests will always be throttled in favour of high priority.
  • If high-priority requests are consistently throttled, it means your configured RU/s is insufficient for your primary workload. Consider increasing RU/s for better performance.

Limitations

  • Not supported on serverless Cosmos DB accounts.
  • Read requests cannot be prioritized against writes for Strong and Bounded Staleness consistency levels.

Resources

Leave a review

Tell us about your Azure Cosmos DB experience! Leave a review on PeerSpot and we’ll gift you $50. Get started here.

About Azure Cosmos DB

Azure Cosmos DB is a fully managed and serverless NoSQL and vector database for modern app development, including AI applications. With its SLA-backed speed and availability as well as instant dynamic scalability, it is ideal for real-time NoSQL and MongoDB applications that require high performance and distributed computing over massive volumes of NoSQL and vector data.

To stay in the loop on Azure Cosmos DB updates, follow us on XYouTube, and LinkedIn.

Author

Richa Gaur
Senior Program Manager

0 comments