In this episode of FinOps on Azure, FinOps certified practitioner – Mike and Gary from the Microsoft Cosmos DB team discuss cost management challenges on Azure, specifically focusing on Cosmos DB. They cover various topics, including provisioned throughput choices, API options, and factors affecting cost.
Cosmos DB offers two provisioning models: manual and auto scale. Manual provisioned throughput is suitable for continuous workloads, while auto scale is ideal for workloads with fluctuating traffic. A new dynamic auto scale provisioning mode was also introduced, which scales each partition independently based on its usage.
Cosmos DB supports multiple APIs, including SQL, MongoDB, Cassandra, Table, and Gremlin. The choice of API depends on the user’s existing skills and the requirements of their application.
The main factors affecting cost are unused resources, provisioned throughput, partition key choice, data storage, and indexing policies. Users should regularly review and remove unused resources, choose the appropriate provisioned throughput model, optimize their partition key, manage data storage efficiently, and configure indexing policies to minimize costs.
A good partition key distributes data and workload evenly across partitions, enabling efficient queries and minimizing costs. Users should avoid hot partitions, which occur when a single partition receives a disproportionate amount of traffic.
Storing large documents or unnecessary data can increase costs. Users should break down large documents into smaller ones and only store data that is frequently accessed in Cosmos DB.
By default, Cosmos DB indexes every property of every document. Users can optimize indexing policies by excluding unnecessary properties or creating composite indexes to improve query performance.
Users can monitor their Cosmos DB usage and costs using Azure portal metrics and Log Analytics. These tools provide insights into request unit charges, operation types, and distribution over time, helping users optimize their Cosmos DB usage.
Users should take advantage of features like auto scale and dynamic auto scale per partition per region to optimize their Cosmos DB costs. They should also design their workloads with cost considerations in mind, making appropriate partition key choices and resource provisioning decisions.