Azure Cosmos DB – Consistency, Partitioning and SDK · AZ-204: Developing Solutions for Microsoft Azure Develop for Azure Storage

An Azure Cosmos DB container stores orders for 10,000 retail stores. Most queries retrieve orders for a specific store, and writes are distributed re…

Practice question from Azure Cosmos DB – Consistency, Partitioning and SDK (AZ-204: Developing Solutions for Microsoft Azure Develop for Azure Storage), with the correct answer and a step-by-step solution.

medium · MCQ · Q-67E383

An Azure Cosmos DB container stores orders for 10,000 retail stores. Most queries retrieve orders for a specific store, and writes are distributed relatively evenly across stores. Which partition key is the best choice for the container?

  1. A./orderStatus
  2. B./orderDate
  3. C./storeIdCorrect answer
  4. D./customerType

Solution

The partition key should support the dominant query pattern and distribute data and request load across many logical partitions. /storeId matches the store-scoped queries and has high enough cardinality to distribute the workload. Status, date, and customer type are more likely to create less useful or uneven partitioning.

More from Azure Cosmos DB – Consistency, Partitioning and SDK

All of Azure Cosmos DB – Consistency, Partitioning and SDK

Practise more Develop for Azure Storage

Sign up free for adaptive practice on this chapter, with instant feedback and hints on every question.

Start practising free

Free to start · No credit card needed