Consistency Levels

From Ilianko
Revision as of 15:07, 26 October 2026 by Anko (talk | contribs) (Recreated DP-420 term page: Consistency Levels (Data Distribution & Consistency))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

← Back to DP-420 Terminology Reference

Category: Data Distribution & Consistency

Summary: Five tunable levels (Strong, Bounded Staleness, Session, Consistent Prefix, Eventual).

Overview

Azure Cosmos DB offers five well-defined, tunable consistency levels, trading off between consistency, availability, latency, and RU cost: Strong (linearizable reads, highest consistency, lowest availability/highest latency), Bounded Staleness (reads lag writes by a bounded time/version window), Session (default; strong consistency within a single client session), Consistent Prefix (reads never see out-of-order writes), and Eventual (lowest consistency, highest availability and lowest latency). The default consistency level is configured at the account level.When an application makes a read request, it can override this default consistency level dynamically per request, but only to a weaker or equal consistency level.

ReadConsistencyStrategy is an exception that allows stronger read consistency than the account default.

More Info & Links

DP-420 Style Practice Questions

Q1. What is the default consistency level in Azure Cosmos DB?

  • A. Session
  • B. Strong
  • C. Eventual
  • D. Consistent Prefix

Q2. Which consistency level offers the strongest guarantees but typically the highest latency and lowest availability during network partitions?

  • A. Strong
  • B. Eventual
  • C. Consistent Prefix
  • D. Session

Q3. Can the consistency level be overridden for an individual read request?

  • A. Yes, you can relax (but not strengthen) the consistency level per request
  • B. No, consistency is fixed permanently at account creation
  • C. Yes, but only for write requests
  • D. No, only Azure support can change it

Answer Key

Answers are listed at the very end so you can attempt the questions first.

  • Q1 (Consistency Levels): A. Session — Session consistency is the default consistency level for new Azure Cosmos DB accounts.
  • Q2 (Consistency Levels): A. Strong — Strong consistency provides linearizable reads, the highest consistency guarantee, at the cost of higher latency and lower availability.
  • Q3 (Consistency Levels): A. Yes, you can relax (but not strengthen) the consistency level per request — You can override the default account consistency level to a weaker level on a per-request basis using query request options.

DP-420: Designing and Implementing Cloud-Native Applications Using Microsoft Azure Cosmos DB — term detail page