Question

Difficulty: EasyConfigure Partition Keys and Partitioning Strategies in Azure Cosmos DB

An organization is designing an Azure Cosmos DB container to store employee profile documents. The system must support high-volume write operations and maintain efficient query performance.

Which two statements describe correct characteristics of Azure Cosmos DB partitioning that must be considered?

  1. Selecting a property with high cardinality, such as employee ID, distributes throughput and storage consumption evenly across physical partitions.Answer
  2. B
    Selecting a property with low cardinality, such as department, is recommended to minimize the creation of physical partitions.
  3. The partition key is defined when the container is created and cannot be updated for that container afterward.Answer
  4. D
    The partition key value of an existing document can be modified directly in place, which automatically migrates the document to the corresponding physical partition.

Answer

Selecting a property with high cardinality distributes throughput and storage evenly, and the partition key cannot be updated for a container after creation.
Selecting a property with high cardinality, such as employee ID, allows Cosmos DB to scale horizontally by distributing the write and read workloads across many partitions. Additionally, the partition key of a container is immutable once created, which is a critical design constraint that requires careful initial planning.

Step-by-Step Solution

1
Evaluate the impact of property cardinality on partition keys.
High cardinality keys distribute data and throughput workload across physical partitions, whereas low cardinality keys lead to hot partitions.
Choosing a unique field ensures that write workloads are spread across many logical and physical partitions, avoiding bottlenecking.
2
Analyze the mutability and lifecycle of partition keys in Azure Cosmos DB.
Partition keys are immutable once a container is created and cannot be updated in place for existing documents.
Because the partition key determines physical distribution logic, changing a container's partition key requires a complete data migration to a new container.

Key Concept

Azure Cosmos DB partitioning strategies, partition key immutability, and cardinality considerations.
Estimated Time:1m 0s
Rate this question