Question

Difficulty: HardSet Consistency Levels for Azure Cosmos DB

Match each application scenario to the most appropriate Azure Cosmos DB consistency level that satisfies the requirements with the lowest resource overhead.

  • A financial ledger application deployed to a single write region with multiple read regions that requires all clients to immediately read the most recently committed state before any subsequent transaction is processed.Strong
  • A globally distributed multiplayer game using a multi-region write account that requires player updates to be viewed in chronological order by all players globally, with a guaranteed lag of no more than 100,000100,000 updates or 55 minutes.Bounded Staleness
  • An e-commerce shopping cart service where a user must always see the items they just added to their cart immediately upon refreshing their browser session, while other users can tolerate propagation delay.Session
  • A video streaming platform's trending list where updates must never appear out of order to readers, but no strict real-time lag bounds are required, optimizing for resource cost.Consistent Prefix

Answer

The correct matches associate the financial ledger with Strong, the multiplayer game with Bounded Staleness, the shopping cart with Session, and the trending video list with Consistent Prefix.
The correct matching aligns the strict linearizability requirement of the financial ledger to Strong consistency; the time/version bounded ordering on multi-region writes to Bounded Staleness; the user-scoped write-read cycle to Session consistency; and the out-of-order prevention without time bounds to Consistent Prefix.

Step-by-Step Solution

1
Analyze the financial ledger requirement.
It requires absolute global consistency ('immediately read the most recently committed state') which can only be satisfied by Strong consistency.
Strong consistency guarantees that any read returns the most recent write globally, preventing stale reads across regions.
2
Analyze the multiplayer game requirement.
It runs on a multi-region write account and requires a bound on replication lag (100,000100,000 updates or 55 minutes) along with ordered reads. This corresponds to Bounded Staleness consistency.
Bounded Staleness allows multi-region writes while ensuring that reads outside the write region do not lag beyond the configured threshold of KK versions or TT time.
3
Analyze the shopping cart requirement.
It requires read-your-own-writes for a single user's browser session. Session consistency provides this guarantee within the client session.
Session consistency scope guarantees read-your-own-writes and monotonic reads for the specific client using the session token.
4
Analyze the trending list requirement.
It requires updates to never appear out of order but has no strict lag bounds. Consistent Prefix meets this ordering requirement with lower resource overhead.
Consistent Prefix ensures that readers see updates in the order they were written without incurring the higher RU cost and latency of Bounded Staleness.

Key Concept

Azure Cosmos DB consistency levels and their trade-offs regarding replication latency, throughput, ordering guarantees, and availability.
Rate this question