πŸ”’ Guided

Pre-launch preview. Authorised access only.

Incorrect code

Guided by A Guide to Cloud
Explore AB-900 AI-901
Guided DP-420 Domain 2
Domain 2 β€” Module 1 of 3 33%
12 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 ⏱ ~14 min read

Global Replication and Failover

Learn when and how to distribute Cosmos DB data globally, configure automatic failover policies, and perform manual failovers β€” including the critical detail that a recovered region returns as read-only.

Why go global?

β˜• Simple explanation

Imagine GlobeCart has warehouses in 12 countries. If all your product data sits in one warehouse in Sydney, customers in London wait for every request to fly halfway around the world.

Global replication copies your data to multiple Azure regions so reads (and optionally writes) happen close to each customer. If Sydney burns down, London keeps serving.

Global distribution in Cosmos DB replicates your data across Azure regions transparently. Each replica maintains the full dataset and can serve reads. Key motivations:

  • Latency: Serve reads from the nearest region β€” single-digit milliseconds at P99.
  • Availability: Survive regional outages without downtime.
  • Compliance: Keep data copies in mandated geographies (data residency).
  • Throughput: Spread read traffic across regions to avoid hotspots.

You can add or remove regions at any time with zero downtime β€” Cosmos DB handles the data migration.

Jake’s scenario: taking GlobeCart global

πŸ›’ Jake at GlobeCart has 50M products served from East US. European customers complain about 200ms+ latency on product searches. His plan:

  1. Add West Europe and Southeast Asia as read replicas β€” product catalogue reads drop to under 10 ms locally.
  2. Configure automatic failover β€” if East US goes down, West Europe takes over writes.
  3. Keep a single write region (for now) β€” simpler consistency, lower cost.

Single-write vs multi-write architecture

AspectSingle-Write RegionMulti-Write Regions
Write latencyLow in write region, high everywhere elseLow everywhere β€” writes go to nearest region
Availability SLA99.99% (four nines)99.999% (five nines)
Conflict resolutionNot needed β€” one writerRequired β€” Last-Writer-Wins or custom
Consistency optionsAll five levels availableStrong and bounded staleness NOT available
CostStandard RU/s Γ— regionsHigher β€” every region serves writes
ComplexitySimple β€” one source of truthComplex β€” conflict handling, eventual consistency

Automatic failover

Automatic failover kicks in when the write region experiences an outage. Cosmos DB promotes the next region in your priority list.

Failover priority (Jake's config):
  Priority 0: East US        ← current write region
  Priority 1: West Europe    ← first to promote if East US fails
  Priority 2: Southeast Asia ← second in line

Critical exam detail β€” the recovered region: When East US recovers after a failover, it does not automatically become the write region again. It rejoins as a read-only replica at the lowest priority. Jake must manually reprioritize if he wants East US back as the writer.

πŸ’‘ Exam tip: automatic failover timing

Automatic failover is not instant. Cosmos DB waits for a configurable detection period before triggering promotion. During this window, writes fail but reads from other regions continue.

The exam tests whether you know the write region goes down first, then failover promotes a read region β€” there’s always a brief write outage.

Manual failover

Manual failover is operator-triggered and guarantees zero data loss. Use it for:

  • Planned maintenance or region migration
  • Disaster recovery drills
  • Moving the write region closer to shifting traffic patterns
# Trigger manual failover β€” promote West Europe to write region
az cosmosdb failover-priority-change \
  --name globecart-cosmos \
  --resource-group rg-globecart \
  --failover-policies "westeurope=0" "eastus=1" "southeastasia=2"
// Verify current write region via SDK
AccountProperties account = await client.ReadAccountAsync();
foreach (AccountRegion region in account.WritableRegions)
{
    Console.WriteLine($"Write region: {region.Name}");
}

Service-managed vs automatic failover

FeatureService-Managed FailoverAutomatic Failover (customer-enabled)
TriggerAzure detects prolonged outageYou enable it; Azure detects outage and acts
ControlMicrosoft decides when to failoverYou set priority list, Azure executes
Write downtimeLonger β€” at Microsoft's discretionShorter β€” detection triggers promotion
Data loss riskPossible with async replicationPossible with async replication
Manual failoverAlways zero data lossAlways zero data loss
ConfigurationNone β€” always onEnable + set region priority order
πŸ’‘ Exam tip: SLA numbers you must know
  • 99.99% β€” single-region or multi-region reads (single write region)
  • 99.999% β€” multi-region writes enabled
  • 99.99% for reads on any multi-region account regardless of write config
  • Manual failover = zero data loss guaranteed
  • Automatic failover = potential data loss (unacknowledged writes during detection window)

🎬 Video walkthrough

🎬 Video coming soon

Global Replication and Failover β€” DP-420 Module 12

Global Replication and Failover β€” DP-420 Module 12

~14 min

Flashcards

Question

After an automatic failover, what happens when the original write region recovers?

Click or press Enter to reveal answer

Answer

It rejoins as a READ-ONLY replica at the lowest failover priority. It does NOT automatically become the write region again. You must manually reprioritize to restore it as the writer.

Click to flip back

Question

What is the availability SLA difference between single-write and multi-write Cosmos DB?

Click or press Enter to reveal answer

Answer

Single-write: 99.99% (four nines). Multi-write: 99.999% (five nines). The extra nine comes from eliminating the single write region as a point of failure.

Click to flip back

Question

Does manual failover risk data loss?

Click or press Enter to reveal answer

Answer

No β€” manual failover guarantees zero data loss. It waits for all pending writes to replicate before switching. Automatic failover CAN lose unacknowledged writes because the outage is unplanned.

Click to flip back

Question

Can you add or remove Azure regions from a Cosmos DB account without downtime?

Click or press Enter to reveal answer

Answer

Yes β€” adding or removing regions is a zero-downtime operation. Cosmos DB transparently handles data replication to the new region or drains data from a removed region.

Click to flip back

Knowledge Check

Knowledge Check

GlobeCart's Cosmos DB account has automatic failover enabled with priority: East US (0), West Europe (1), Southeast Asia (2). East US experiences a prolonged outage and failover occurs. After East US recovers, what is the new write region?

Knowledge Check

Jake wants to move GlobeCart's write region from East US to West Europe during a planned maintenance window. Which approach guarantees zero data loss?

Knowledge Check

Which consistency levels are NOT available when multi-region writes are enabled?


Next up: Consistency Levels β€” the five consistency choices in Cosmos DB, their real trade-offs, and why this is the most heavily tested topic on the DP-420 exam.

← Previous

Transactions in Practice

Next β†’

Consistency Levels: Five Choices, Real Trade-Offs

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.