Question

Difficulty: EasySet Consistency Levels for Azure Cosmos DB

A developer is configuring an Azure Cosmos DB account. The application requires that reads must never see out-of-order writes. However, the application can tolerate some replication lag and must not rely on client-managed session tokens. Which two consistency levels meet these requirements? (Select two)

  1. A
    Strong
  2. Bounded StalenessAnswer
  3. C
    Session
  4. Consistent PrefixAnswer
  5. E
    Eventual

Answer

Consistent Prefix and Bounded Staleness are the correct options because they both guarantee that reads never see out-of-order updates (maintaining write order) while allowing replication lag and not requiring client-managed session tokens.
Consistent Prefix and Bounded Staleness both guarantee that updates are returned in the order they were written (Consistent Prefix). Bounded Staleness adds a constraint on how far behind the writes the reads can lag (based on time TT or version count KK), whereas Consistent Prefix allows arbitrary lag as long as order is preserved. Neither requires managing session tokens.

Step-by-Step Solution

1
Evaluate the order requirement
The application requires that reads never see out-of-order writes. This means the consistency level must support Consistent Prefix. Strong, Bounded Staleness, Session, and Consistent Prefix support this, but Eventual does not.
Eliminates Eventual consistency as a candidate.
2
Evaluate the replication lag requirement
The application can tolerate replication lag. Strong consistency does not allow replication lag, as reads must always return the most recent write.
Eliminates Strong consistency as a candidate.
3
Evaluate the session token requirement
The application must not rely on client-managed session tokens. Session consistency requires sharing/using session tokens to guarantee consistency bounds. Bounded Staleness and Consistent Prefix do not require session tokens.
Eliminates Session consistency, leaving Bounded Staleness and Consistent Prefix as the correct choices.

Key Concept

Azure Cosmos DB consistency levels and their guarantees regarding order, replication lag, and session token dependency.
Rate this question