DP-420 · Question #69
You have a container in an Azure Cosmos DB for NoSQL account that stores data about orders. The following is a sample of an order document. Documents are up to 2 KB. You plan to receive one million…
The correct answer is C. There will always be a hot partition D. Queries will run cross-partition. Using orderDate causes two problems: (1) Hot partition - all writes for today's date go to a single logical partition. Since orders arrive continuously, the current date's partition receives all write traffic at all times, making it perpetually hot. (2) Cross-partition queries…
Question
You have a container in an Azure Cosmos DB for NoSQL account that stores data about orders. The following is a sample of an order document. Documents are up to 2 KB. You plan to receive one million orders daily. Customers will frequently view their past order history. You are the evaluating whether to use orderDate as the partition key. What are two effects of using orderDate as the partition key? Each correct answer presents a complete solution. NOTE: Each correct selection is worth one point.
Exhibit
Options
- AYou will exceed the maximum number of partition key values
- BYou will exceed the maximum storage per partition
- CThere will always be a hot partition
- DQueries will run cross-partition
How the community answered
(20 responses)- A10% (2)
- B15% (3)
- C75% (15)
Explanation
Using orderDate causes two problems: (1) Hot partition - all writes for today's date go to a single logical partition. Since orders arrive continuously, the current date's partition receives all write traffic at all times, making it perpetually hot. (2) Cross-partition queries - customers querying their order history will have orders spread across many different date partitions, forcing Cosmos DB to execute fan-out queries across all those partitions, increasing cost and latency. Option A is wrong (date values are not unlimited in a way that exceeds partition key count limits). Option B is wrong because 1M orders × 2KB = ~2GB/day, which does not exceed the 20GB per logical partition limit.
Topics
Community Discussion
No community discussion yet for this question.
