Question 12
UnclassifiedAn application occasionally receives throttling responses from Cosmos DB. What should the developer implement?
Correct answer: D
Explanation
Cosmos DB throttling means the service is limiting requests, so the app should retry using backoff and honor the retry guidance instead of immediately resending traffic. It should also avoid hot partitions, since uneven request distribution can trigger repeated throttling on a single partition.
Why each option is right or wrong
A. Immediate crash with no retry.
B. Deleting the container after each throttle.
C. Infinite tight-loop retries.
D. Retry behavior that respects throttling guidance and avoids hot partitions.
Azure Cosmos DB returns HTTP 429 (Too Many Requests) when a request exceeds the provisioned throughput for a physical partition, and the response includes a server-specified retry-after interval that clients are expected to honor. The SDK guidance is to implement retries with backoff using that retry-after value rather than immediate reissue, and to address repeated 429s by distributing traffic across partition keys because a single hot partition can exhaust its share of RU/s even when the account has capacity overall.