Microsoft Certified: Azure Developer Associate (AZ-204)Develop for Azure storageEasy

A web application uses Azure Cosmos DB to store user profiles. The application experiences unpredictable spikes in traffic, leading to varying throughput requirements. To optimize costs and performance, the developer wants Cosmos DB to automatically scale its throughput based on demand.

  1. AEnable autoscale provisioned throughput on the Cosmos DB container.
  2. BImplement a custom scaling logic using Azure Functions to monitor and adjust RUs.
  3. CManually adjust the Request Units (RUs) of the Cosmos DB container during peak hours.
  4. DConfigure the Cosmos DB container with provisioned throughput (manual).
Show answer & explanation

Correct answer: A. Enable autoscale provisioned throughput on the Cosmos DB container.

Azure Cosmos DB's autoscale provisioned throughput feature allows the service to automatically scale the Request Units (RUs) of a container or database based on usage, which is ideal for workloads with unpredictable traffic patterns, ensuring optimal performance and cost efficiency.

Why the other options are wrong

  • B. While possible, implementing custom scaling logic is complex and unnecessary, as Cosmos DB provides a built-in autoscale feature.
  • C. Manually adjusting RUs is reactive and prone to human error, not suitable for unpredictable spikes.
  • D. Manual provisioned throughput requires static RU allocation, which is inefficient for variable workloads.

Cosmos DB Autoscale Throughput

Autoscale provisioned throughput in Azure Cosmos DB automatically scales the Request Units per second (RU/s) of your database or container based on usage, optimizing costs and performance for variable workloads.

  • Automatically adjusts RU/s based on traffic.
  • Ideal for unpredictable and variable workloads.
  • Helps optimize costs by only paying for consumed throughput within a defined range.

Memory trick: Auto-scaling is smart for spiky loads.

More Develop for Azure storage questions