An online food delivery service is designing a real-time driver tracking system on Azure. The system will ingest GPS coordinates every 5 seconds from 50,000 drivers. The solution must support sub-10ms write latency, distribute write operations evenly to prevent performance degradation, and remain available in the event of a regional datacenter outage. The primary query will retrieve the latest coordinates for a specific active trip using its unique trip identifier (a high-cardinality GUID). Which configuration should you recommend?
- Set the partition key to the trip identifier and enable multi-region writes for the Azure Cosmos DB account.Answer
- BSet the partition key to the vehicle type and enable multi-region writes for the Azure Cosmos DB account.
- CSet the partition key to the trip identifier and configure the account as a single-region deployment using Locally Redundant Storage (LRS).
- DSet the partition key to the trip identifier, enable multi-region writes, and use an embedded 3-year Shared Access Signature (SAS) token in the client for direct archival to Azure Blob Storage.
Answer
Set the partition key to the trip identifier and enable multi-region writes for the Azure Cosmos DB account.
The correct design uses the high-cardinality trip identifier (GUID) as the partition key to distribute write workloads evenly across partitions, combined with multi-region writes to satisfy the sub-10ms write latency and regional disaster resilience requirements.
Step-by-Step Solution
Key Concept
Designing partition keys for even throughput distribution and multi-region replication for disaster recovery in Azure Cosmos DB.