🔒 Guided

Pre-launch preview. Authorised access only.

Incorrect code

Guided by A Guide to Cloud
Explore AB-900 AI-901 aws-aif-c01
Guided DP-420 Domain 2
Domain 2 — Module 2 of 3 67%
13 of 28 overall

DP-420 Study Guide

Domain 1: Design and Implement Data Models

  • Cosmos DB — The Big Picture Free
  • Designing Your Data Model Free
  • Partition Key Strategy Free
  • Synthetic and Hierarchical Partition Keys Free
  • Relationships — Embedding vs Referencing Free
  • SDK Connectivity and Client Configuration Free
  • SDK CRUD Operations and Transactions Free
  • SQL Queries in Cosmos DB Free
  • SDK Query Pagination and LINQ Free
  • Server-Side Programming Free
  • Transactions in Practice Free

Domain 2: Design and Implement Data Distribution

  • Global Replication and Failover
  • Consistency Levels: Five Choices, Real Trade-Offs
  • Multi-Region Writes and Conflict Resolution

Domain 3: Integrate and Move Data

  • Change Feed with Azure Functions and Processors
  • Analytical Workloads: Synapse Link and Fabric Mirroring
  • Data Movement: ADF, Kafka, and Spark Connectors

Domain 4: Optimize Query and Operation Performance

  • Indexing Policies: Range, Spatial, and Composite
  • Request Units and Query Cost Optimization
  • Integrated Cache and Dedicated Gateway
  • Change Feed Patterns: Materialized Views and Estimator

Domain 5: Maintain an Azure Cosmos DB Solution

  • Monitoring: Metrics, Logs, and Alerts
  • Backup and Restore: Periodic vs Continuous
  • Network Security: Firewalls, VNets, and Private Endpoints
  • Data Security: Encryption, Keys, and RBAC
  • Cost Optimization: Throughput Modes and RU Strategy
  • DevOps: Infrastructure as Code and Deployments
  • Exam Strategy and Cross-Domain Review

DP-420 Study Guide

Domain 1: Design and Implement Data Models

  • Cosmos DB — The Big Picture Free
  • Designing Your Data Model Free
  • Partition Key Strategy Free
  • Synthetic and Hierarchical Partition Keys Free
  • Relationships — Embedding vs Referencing Free
  • SDK Connectivity and Client Configuration Free
  • SDK CRUD Operations and Transactions Free
  • SQL Queries in Cosmos DB Free
  • SDK Query Pagination and LINQ Free
  • Server-Side Programming Free
  • Transactions in Practice Free

Domain 2: Design and Implement Data Distribution

  • Global Replication and Failover
  • Consistency Levels: Five Choices, Real Trade-Offs
  • Multi-Region Writes and Conflict Resolution

Domain 3: Integrate and Move Data

  • Change Feed with Azure Functions and Processors
  • Analytical Workloads: Synapse Link and Fabric Mirroring
  • Data Movement: ADF, Kafka, and Spark Connectors

Domain 4: Optimize Query and Operation Performance

  • Indexing Policies: Range, Spatial, and Composite
  • Request Units and Query Cost Optimization
  • Integrated Cache and Dedicated Gateway
  • Change Feed Patterns: Materialized Views and Estimator

Domain 5: Maintain an Azure Cosmos DB Solution

  • Monitoring: Metrics, Logs, and Alerts
  • Backup and Restore: Periodic vs Continuous
  • Network Security: Firewalls, VNets, and Private Endpoints
  • Data Security: Encryption, Keys, and RBAC
  • Cost Optimization: Throughput Modes and RU Strategy
  • DevOps: Infrastructure as Code and Deployments
  • Exam Strategy and Cross-Domain Review
Domain 2: Design and Implement Data Distribution Premium ⏱ ~18 min read

Consistency Levels: Five Choices, Real Trade-Offs

Master all five Cosmos DB consistency levels — strong, bounded staleness, session, consistent prefix, and eventual — with analogies, technical detail, and the trade-offs the exam loves to test.

The consistency spectrum

☕ Simple explanation

Think of a news broadcast. Strong consistency is a live broadcast — everyone sees the same thing at the same time, but there’s a slight delay. Eventual consistency is a newspaper — fast to print, but different readers might get different editions for a while.

Cosmos DB gives you five points on this spectrum. More consistency = higher latency and cost. Less consistency = faster and cheaper, but readers might see stale data temporarily.

Cosmos DB offers five consistency levels, forming a spectrum from strongest (linearizable) to weakest (eventual). Each level provides a different balance of:

  • Consistency: How up-to-date are reads guaranteed to be?
  • Availability: Can the system serve requests during partial outages?
  • Latency: How fast are reads and writes?
  • Throughput: How many RU/s does each operation cost?

This is the most tested topic on DP-420. Expect 5-8 questions on consistency trade-offs.

Jake’s consistency dilemma

🛒 Jake at GlobeCart has replicated his product catalogue to three regions. But now he faces questions:

  • When a seller updates a price in East US, how quickly must customers in Europe see it?
  • When a customer adds an item to their cart, must the next read reflect it immediately?
  • Is it OK if product reviews appear slightly delayed across regions?

Each answer points to a different consistency level. Let’s explore all five.

The five levels

1. Strong consistency

Guarantee: Every read returns the most recent committed write. Linearizable — as if there’s a single copy of the data.

Analogy: A live video call — everyone sees the same thing at the same millisecond.

  • Latency: Highest read latency (waits for quorum across regions)
  • RU cost: 2× the RU cost of a standard read
  • Restriction: ⚠️ Not available with multi-region writes
  • Use case: Financial transactions, inventory counts where stale reads cause real-world harm

2. Bounded staleness

Guarantee: Reads may lag behind writes by at most K operations or T seconds, whichever is reached first.

Analogy: A sports ticker with a guaranteed maximum delay — you might be 5 seconds behind live, but never more.

  • Configuration: You set K (version count) and T (time interval)
  • Multi-region minimum: K ≥ 100,000 operations AND T ≥ 300 seconds
  • Single-region minimum: K ≥ 10 operations AND T ≥ 5 seconds
  • RU cost: 2× the RU cost for reads (same as strong)
  • Restriction: ⚠️ Not available with multi-region writes
  • Use case: Leaderboards, analytics dashboards where “near-real-time” is acceptable

3. Session consistency (DEFAULT)

Guarantee: Within a single client session, reads always reflect that session’s own writes (read-your-own-writes). Other sessions may see older data.

Analogy: Your own notepad — you always see what you just wrote, but your colleague’s notepad might not be updated yet.

  • Latency: Low — no cross-region coordination for your own session
  • RU cost: Standard (1×)
  • Why it’s the default: Most applications need “I see what I just wrote” without caring about other users’ sessions
  • Use case: Shopping carts, user profiles, most CRUD applications

4. Consistent prefix

Guarantee: Reads never see out-of-order writes. If writes happen as A → B → C, reads see A, A→B, or A→B→C — never A→C skipping B.

Analogy: Watching a TV show — you might be behind, but episodes always play in order.

  • Latency: Low
  • RU cost: Standard (1×)
  • Use case: Social media feeds, event logs, chat message history

5. Eventual consistency

Guarantee: Reads will eventually return the most recent write, but there’s no bound on when. Reads may be out of order.

Analogy: A newspaper — eventually everyone gets the news, but different readers see different editions at different times.

  • Latency: Lowest
  • RU cost: Lowest (slightly less than session for reads)
  • Use case: Like counts, view counters, telemetry, non-critical metrics

Comparison at a glance

LevelGuaranteeRead RU CostLatencyMulti-Region Writes?
StrongLinearizable — latest write always2×Highest❌ No
Bounded StalenessWithin K ops or T seconds2×High❌ No
Session (DEFAULT)Read-your-own-writes per session1×Low✅ Yes
Consistent PrefixNo out-of-order reads1×Low✅ Yes
EventualNo guarantees on freshness/order1×Lowest✅ Yes
💡 Exam tip: consistency per-request relaxation

The account-level default consistency can be relaxed (weakened) on a per-request basis using SDK headers. You can go from Strong → Bounded Staleness → Session → Consistent Prefix → Eventual.

You cannot strengthen consistency per-request. If the account is set to Session, you cannot request Strong on individual reads. This is a favourite exam question — know the direction of relaxation.

Bounded staleness deep dive

Multi-region bounded staleness minimums:
  K ≥ 100,000 operations
  T ≥ 300 seconds (5 minutes)

Single-region bounded staleness minimums:
  K ≥ 10 operations
  T ≥ 5 seconds

Why the multi-region minimum is high: Cross-region replication has inherent latency. Setting K=10 across continents would cause constant consistency violations. The minimums ensure the staleness window is realistic.

// Bounded staleness is configured at the account level:
// az cosmosdb update --name globecart-cosmos \
//   --default-consistency-level BoundedStaleness \
//   --max-staleness-prefix 100000 \
//   --max-interval 300
💡 Exam tip: the 2× read cost trap

Both Strong and Bounded Staleness cost 2× RU for reads because they require quorum confirmation from multiple replicas. Session, Consistent Prefix, and Eventual all cost 1× because reads go to a single replica.

Exam questions often ask about “cost-effective” consistency — if the scenario doesn’t require strong guarantees, Session is almost always the right answer (and it’s the default).

Per-request consistency in code

// Account default: Session
// Relax to Eventual for a non-critical read
ItemRequestOptions options = new ItemRequestOptions
{
    ConsistencyLevel = ConsistencyLevel.Eventual
};

ItemResponse<Product> response = await container.ReadItemAsync<Product>(
    id: "product-123",
    partitionKey: new PartitionKey("electronics"),
    requestOptions: options
);

Sophie’s pro tip: 🗄️ Sophie, Jake’s DBA, uses Session consistency for the shopping cart (customers must see their own changes) but relaxes to Eventual for product review counts (a few seconds of staleness is fine and saves RU cost).

🎬 Video walkthrough

🎬 Video coming soon

Consistency Levels — DP-420 Module 13

Consistency Levels — DP-420 Module 13

~18 min

Flashcards

Question

What is the DEFAULT consistency level in Cosmos DB?

Click or press Enter to reveal answer

Answer

Session consistency. It guarantees read-your-own-writes within a single client session. It's the most popular choice because it balances consistency with low latency and standard RU cost.

Click to flip back

Question

Which two consistency levels cost 2× RU for reads?

Click or press Enter to reveal answer

Answer

Strong and Bounded Staleness. Both require quorum reads from multiple replicas, doubling the read cost. Session, Consistent Prefix, and Eventual all cost 1× (standard).

Click to flip back

Question

What are the minimum bounded staleness values for a multi-region Cosmos DB account?

Click or press Enter to reveal answer

Answer

K ≥ 100,000 operations AND T ≥ 300 seconds (5 minutes). For single-region: K ≥ 10 operations and T ≥ 5 seconds. The multi-region minimums are high because cross-region replication has inherent latency.

Click to flip back

Question

Can you strengthen consistency on a per-request basis?

Click or press Enter to reveal answer

Answer

No — you can only WEAKEN (relax) consistency per-request. If the account default is Session, you can relax to Consistent Prefix or Eventual, but you cannot request Strong or Bounded Staleness. Direction: Strong → Bounded → Session → Prefix → Eventual.

Click to flip back

Question

Which consistency levels are NOT available with multi-region writes?

Click or press Enter to reveal answer

Answer

Strong and Bounded Staleness. Both require a single authoritative write region to enforce their ordering guarantees. Multi-region writes support Session, Consistent Prefix, and Eventual.

Click to flip back

Knowledge Check

Knowledge Check

Jake's GlobeCart has multi-region writes enabled across three regions. He wants the strongest possible consistency. Which level should he choose?

Knowledge Check

A Cosmos DB account is set to Strong consistency. A developer wants to read product reviews with Eventual consistency to save RU cost. How can they achieve this?

Knowledge Check

Sophie configures bounded staleness with K=50 operations and T=120 seconds on a multi-region Cosmos DB account. What happens?

Knowledge Check

GlobeCart needs to display a customer's shopping cart immediately after they add an item. Which consistency level is the most cost-effective choice?


Next up: Multi-Region Writes and Conflict Resolution — what happens when two regions write to the same document at the same time, and how Cosmos DB resolves the conflict.

← Previous

Global Replication and Failover

Next →

Multi-Region Writes and Conflict Resolution

Guided

I learn, I simplify, I share.

A Guide to Cloud YouTube Feedback

© 2026 Sutheesh. All rights reserved.

Guided is an independent study resource and is not affiliated with, endorsed by, or officially connected to Microsoft. Microsoft, Azure, and related trademarks are property of Microsoft Corporation. Always verify information against Microsoft Learn.