Microsoft Certified: Azure Developer Associate (AZ-204)Develop for Azure storageHard
A large-scale multiplayer online game uses Azure Cosmos DB to store player profiles, game states, and high scores. Player profiles and game states are updated frequently. The game experiences peak loads with millions of concurrent players during events. The data needs to be globally distributed for low-latency access from any region. The development team needs to programmatically manage the throughput (Request Units per second) for specific containers to handle fluctuating demand and optimize costs. Which Cosmos DB feature allows for this dynamic throughput management?
- AAutoscale provisioned throughput
- BServerless capacity mode
- CManual provisioned throughput
- DShared throughput database
Show answer & explanationAnswer & explanation
Correct answer: A. Autoscale provisioned throughput
Autoscale provisioned throughput in Azure Cosmos DB allows the system to automatically scale the Request Units per second (RU/s) up or down based on actual usage, within a defined maximum limit. This is ideal for unpredictable workloads like a multiplayer game, optimizing costs by only paying for the throughput consumed while ensuring performance during peak loads.
Why the other options are wrong
- B. Serverless capacity mode is consumption-based but has lower RU/s limits and is not suitable for sustained high-demand applications with millions of concurrent users.
- C. Manual provisioned throughput requires constant monitoring and manual adjustments, which is inefficient for highly variable workloads.
- D. Shared throughput database shares RU/s across multiple containers, which can lead to resource contention if one container experiences a sudden spike, and doesn't offer dynamic scaling per container.
Cosmos DB Autoscale Throughput
A feature that automatically and instantly scales the RU/s of a Cosmos DB database or container based on usage, within a user-defined max RU/s.
- Automatically scales up/down to meet demand.
- Optimizes costs by only paying for consumed throughput.
- Guarantees performance even during unpredictable spikes.
- Billing is based on the highest RU/s scaled to within the hour.
Memory trick: Think of throughput as a dynamic 'volume knob' for your database.