Explanation
Why the waste happens and who it affects.
Yet in many environments, cold data such as logs, telemetry, or historical records is retained in Cosmos DB due to a lack of lifecycle management.
Billing model
The pricing dimensions that drive this cost.
Cosmos DB charges include:
- Data storage billed per GB per month, across all regions where data is replicated
- Manual provisioned throughput (RU/s), billed per hour for the RU/s provisioned regardless of actual usage; autoscale is billed per hour for the highest RU/s scaled to (never below 10% of the configured maximum), and serverless is billed per RU consumed
- Backup storage billed separately (if configured)
- Serverless mode available, but subject to limitations on scaling and total RU consumption
Storing cold data incurs persistent storage charges and may inflate RU requirements unnecessarily.
How to detect
4 checks to find it in your estate.
- Identify Cosmos DB resources (e.g., containers, collections, or tables) with high storage usage but low request volume
- Use Azure Monitor, diagnostic logs, or Azure Cosmos DB insights to assess read/write activity over time
- Evaluate whether the data is actively queried or needed for operational workloads
- Check whether data retention or lifecycle policies are defined for the resource
How to fix
7 ways to remove the waste.
- Export infrequently accessed data to lower-cost storage services:
- Use Blob Storage Cool for rarely accessed but readily retrievable data
- Use Blob Storage Archive for long-term retention with delayed retrieval
- Use Azure Table Storage for simple key/value access when global distribution is unnecessary
- Delete cold data from Cosmos DB after successful archival
- Implement data lifecycle automation to routinely transition stale data out of Cosmos DB
- Set a time to live (TTL) on containers or items so Cosmos DB automatically deletes cold data after a set period once it is archived or no longer needed
Documentation
Vendor references for pricing and configuration.
- Azure Cosmos DB Pricingazure.microsoft.com
- Plan and manage costs for Azure Cosmos DBlearn.microsoft.com
- Create Containers and Databases with Autoscale Throughputlearn.microsoft.com
- Azure Blob Storage Access Tierslearn.microsoft.com
- Azure Table Storage Overviewlearn.microsoft.com
- Expire Data With Time to Livelearn.microsoft.com