An organization is deploying a globally distributed discussion forum application. The database is hosted on an Azure Cosmos DB API for NoSQL account configured with a single write region in East US and a read region in West US. To prevent hot partitions, the development team has configured a high-cardinality partition key on the container. The application requires that users reading posts in West US must always see updates in the exact chronological order in which they were written. Additionally, the database must minimize Request Unit (RU) costs, ensuring read operations consume only 1 RU. Which two consistency levels should you select to meet these requirements? (Select two.)
- AStrong
- BBounded Staleness
- SessionAnswer
- Consistent PrefixAnswer
- EEventual
Answer
Session and Consistent Prefix
The correct options are Session and Consistent Prefix. Consistent Prefix guarantees that readers will see updates in the order they were written. Session consistency also guarantees consistent prefix order (along with read-your-writes, monotonic reads, and monotonic writes within a session). Both Session and Consistent Prefix consistency levels use a single replica read, which costs 1 RU for standard 1 KB point reads.
Step-by-Step Solution
Key Concept
Azure Cosmos DB consistency levels and their trade-offs in terms of read latency, RU cost, and ordering guarantees.