Question

Difficulty: MediumSet Consistency Levels for Azure Cosmos DB

A company is developing a globally distributed retail catalog application. The database is hosted on an Azure Cosmos DB API for NoSQL account with a single write region in East US and a read-only replica in West US. The application requires that multiple independent client applications reading from the West US region must observe updates in the exact sequence they were committed in East US. To optimize performance and reduce request unit (RU) consumption, the consistency level must offer the lowest latency and resource cost possible while still guaranteeing ordered reads. Which consistency level should you configure for the Azure Cosmos DB account?

  1. A
    Session
  2. Consistent PrefixAnswer
  3. C
    Eventual
  4. D
    Strong

Answer

Consistent Prefix
Consistent Prefix consistency guarantees that reads never see out-of-order writes. It ensures that updates are returned in the order they were made, while offering the lowest read latency and Request Unit (RU) cost (matching Eventual consistency).

Step-by-Step Solution

1
Analyze client session constraints.
Multiple independent client applications need to see updates in order, which rules out Session consistency unless session tokens are manually passed and synchronized.
Session consistency is scoped to a single client session by default.
2
Evaluate ordering guarantees.
The clients must observe updates in the sequence they were committed, which rules out Eventual consistency.
Eventual consistency does not guarantee read order.
3
Compare Consistent Prefix and Strong consistency.
Consistent Prefix satisfies the order requirement with the lowest latency and resource cost, whereas Strong consistency incurs high latency and double the RU cost.
Consistent Prefix offers the same low latency and RU cost as Eventual consistency.

Key Concept

Azure Cosmos DB Consistency Levels
Estimated Time:1m 30s
Rate this question