Question

Difficulty: EasyAzure Cosmos DB and NoSQL Solutions

A company is developing a fleet management application. The application will store real-time telemetry from 50,000 delivery vehicles. The workload has a read/write ratio of 80% writes and 20% reads. The data must be distributed across three Azure regions to support global users, and the solution must avoid partition throttling while maintaining high availability. Which configuration should you recommend for the Azure Cosmos DB container?

  1. Use vehicleId as the partition key and enable multi-region replication.Answer
  2. B
    Use vehicleStatus as the partition key and enable locally redundant storage (LRS).
  3. C
    Use vehicleId as the partition key and authenticate clients using a Shared Access Signature (SAS) token with a 5-year duration.
  4. D
    Use vehicleId as the partition key and configure locally redundant storage (LRS) to minimize costs.

Answer

Use vehicleId as the partition key and enable multi-region replication.
The correct option is to use vehicleId as the partition key and enable multi-region replication. vehicleId is a high-cardinality key that distributes writes evenly across logical partitions, while multi-region replication ensures low latency and high availability across the three target regions.

Step-by-Step Solution

1
Evaluate the partition key requirements based on the high write volume (80% writes).
Identify that a high-cardinality key is required to distribute writes evenly and avoid hot partitions.
Choosing a low-cardinality key like status or date would concentrate writes into a few partitions, leading to throttling.
2
Evaluate the replication and redundancy requirements for a global application in three regions.
Identify that multi-region replication is required to serve users globally.
Locally redundant storage (LRS) keeps data within a single datacenter facility and cannot support multi-region distribution.

Key Concept

Selecting high-cardinality partition keys and configuring appropriate global distribution in Azure Cosmos DB to prevent throttling and ensure high availability.
Rate this question