You are designing an Azure Cosmos DB NoSQL API database to support a global shopping cart service. The database must support a write-heavy workload consisting of 90% writes and 10% reads, provide a 99.999% write availability SLA, and survive a regional outage. You need to recommend a design configuration that prevents hot partitions, meets the SLA, and secures the data access. Which of the following design configurations should you recommend?
- Configure the container with a partition key of SessionId and enable multi-region writes.Answer
- BConfigure the container with a partition key of CartStatus and enable single-region writes.
- CConfigure the Cosmos DB account with Locally Redundant Storage (LRS) replication to meet the regional disaster recovery requirements.
- DGenerate a Shared Access Signature (SAS) token with a five-year lifetime and no stored access policy for database access.
Answer
Configure the container with a partition key of SessionId and enable multi-region writes.
The correct configuration uses SessionId as a partition key to distribute write-heavy cart updates evenly across partition resources, preventing hot partitions. Enabling multi-region writes allows write operations to be processed in multiple regions simultaneously, which satisfies the 99.999% write SLA and guarantees resilience to a regional outage.
Step-by-Step Solution
Key Concept
Partition key selection and high-availability configuration in Azure Cosmos DB