In this tutorial, we'll explore how pricing and provisioning work in Azure Cosmos DB, especially for the NoSQL API.
Understanding Cosmos DB Pricing:
Azure Cosmos DB pricing falls into three main categories:
1. Compute Pricing
Compute pricing based on two things, one is based on throughput (Request Units or RUs) and other is on vCore machine.
In the NoSQL API, only Request Units (RUs) method is available as the only compute method.
Throughput can be provisioned in two modes:
Standard Provisioned Throughput
Auto scale Throughput
2. Storage Pricing
Charges are calculated based on the total GBs of data stored in your container.
Pricing depends on the actual consumed storage.
3. Bandwidth Pricing
There is no charge for data ingress (incoming traffic).
Data egress (outgoing traffic across zones or regions) is billed accordingly.
Provisioned Throughput Pricing:
Pricing depends on:
The number of RUs you provision.
The number of regions your Cosmos DB account is deployed in.
Minimum standard provisioned throughput is 400 RUs
Example: 400 RUs in a single region = approx. $5.84/month
Adding more regions increases the overall cost.
Autoscale Provisioned Throughput:
Charged at 1.5× the rate of standard throughput.
Best for scenarios with unpredictable user traffic.
Pricing also depends on the operation types:
Reads
Writes (including multi-region writes)
Serverless provisioning:
- No autoscale is available for peak loads.
- No multi-region writes
- We cannot increase RUs above the limit. (Capped at 5000 RUs per container)
Storage types and Pricing:
Azure Cosmos DB provides flexible and powerful data storage options tailored for modern cloud-native applications. When using the NoSQL API, you have access to two types of storage:
1. Transactional Storage (Row-Oriented) This is the default storage engine. It supports transactional workloads and costs approximately $0.25 per GB per region per month.
2. Analytical Storage (Column-Oriented) Used for big data analytics and enabled separately, this storage costs just $0.03 per GB per region per month. It's ideal for running queries across massive datasets using Synapse Link or Spark.
For data protection, Azure Cosmos DB supports two backup strategies:
Periodic Backup, which stores snapshots at regular intervals.
Continuous Backup, which allows point-in-time to restore for up to 30 days.
Throughput Provisioning Models:
You can provision throughput in Azure Cosmos DB at two levels:
1. Container-Level Throughput: This model dedicates a fixed number of Request Units per second (RU/s) to a single container. It offers performance isolation and predictable capacity.
2. Database-Level Throughput: Shared across multiple containers in a database; this model allows containers to borrow unused RU/s from others. However, shared throughput is only available for up to 25 containers — going beyond this limit requires a support request, and new containers must use dedicated throughput.
Key Considerations
Throughput can’t be shared beyond 25 containers without intervention.
You need to raise support request if you need more than 25 containers in cosmos db NoSQL API.
Every 10,000 RUs will create one physical partition in cosmos db. So, if you keep on increasing the RUs, you will hit a soft limit where you need to contact Azure support to increase the soft limit.
Comments
Post a Comment