Question

Difficulty: MediumSet Consistency Levels for Azure Cosmos DB

An organization is designing several applications that will use Azure Cosmos DB API for NoSQL. You must select the appropriate default consistency level for each application based on its specific requirements.

Match each application requirement on the left to its optimal Azure Cosmos DB consistency level on the right.

  • A collaborative document editor where a user must always see their own modifications immediately, while other users may observe the changes after a replication lag.Session consistency
  • A financial transaction ledger where reads must always return the absolute latest committed version of a record across all globally distributed regions.Strong consistency
  • A sports live score tracker where updates must be read in the order they occurred (e.g., scoring a goal must not appear before starting the match), but a slight delay in receiving updates is acceptable.Consistent Prefix consistency
  • A weather monitoring system where reads from global read regions can lag behind the single write region, but by no more than 100 updates or 5 minutes.Bounded Staleness consistency

Answer

Match the collaborative document editor to Session consistency, the financial transaction ledger to Strong consistency, the sports live score tracker to Consistent Prefix consistency, and the weather monitoring system to Bounded Staleness consistency.
Matching the requirements to their respective consistency levels aligns with their architectural guarantees: Strong consistency guarantees real-time global updates; Session consistency guarantees read-your-own-writes within the client connection context; Consistent Prefix consistency ensures that updates are never observed out of order; and Bounded Staleness consistency restricts staleness to a defined time or version threshold.

Step-by-Step Solution

1
Analyze the financial transaction ledger requirement for absolute latest committed version globally.
Identify that only Strong consistency guarantees that reads always return the most recent committed version of an item across all regions.
Strong consistency offers linearizability, ensuring reads are guaranteed to return the latest committed write.
2
Analyze the collaborative document editor requirement for a user reading their own modifications immediately.
Identify that Session consistency is the optimal choice as it guarantees read-your-own-writes (RYOW) within a client session.
Session consistency provides monotonic reads and writes, scoping consistency guarantees to the client session.
3
Analyze the sports live score tracker requirement for ordered reads with acceptable lag.
Identify that Consistent Prefix consistency guarantees that reads never see out-of-order writes.
Consistent Prefix ensures that readers see updates in the exact order they were written, even if there is propagation delay.
4
Analyze the weather monitoring system requirement for lag limits of 100 updates or 5 minutes.
Identify that Bounded Staleness consistency is designed specifically to restrict staleness to a defined window of operations or time.
Bounded Staleness allows defining staleness bounds in terms of version lag (K) or time interval (T).

Key Concept

Selecting and configuring the correct Azure Cosmos DB consistency level based on application latency, throughput, and consistency requirements.
Rate this question