πŸ”’ 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 5
Domain 5 β€” Module 5 of 7 71%
26 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 5: Maintain an Azure Cosmos DB Solution Premium ⏱ ~16 min read

Cost Optimization: Throughput Modes and RU Strategy

Choose between serverless, provisioned manual, and autoscale throughput β€” then apply cost reduction strategies including TTL cleanup, reserved capacity, consistency choices, and indexing optimisation.

The cost equation

β˜• Simple explanation

Think of throughput modes like phone plans. Serverless is pay-as-you-go (great for light use, expensive at scale). Provisioned is a fixed plan (predictable cost, wasted if you don’t use it). Autoscale is a plan that flexes between a minimum and maximum (best of both worlds, slightly more expensive at peak).

Cosmos DB cost is driven by three primary factors:

  • Throughput: RU/s provisioned or consumed β€” typically 70-80% of the bill.
  • Storage: Data + index storage per GB per month.
  • Additional features: Multi-region replication, continuous backup (30-day), dedicated gateway, analytical store.

Choosing the right throughput mode is the single biggest cost lever.

Marcus’s cost challenge

βš™οΈ Marcus at FinSecure manages three environments with very different patterns:

  • Production: Predictable traffic with a 2Γ— spike during market hours (9am-4pm)
  • Staging: Used 8 hours/day, idle 16 hours
  • Dev/test: Sporadic use, often idle for days

Each environment needs a different throughput strategy.

Throughput modes comparison

AspectServerlessProvisioned (Manual)Autoscale
BillingPer-RU consumedPer-RU/s provisioned (hourly)Per max RU/s used in each hour
Throughput range5,000 RU/s per physical partitionFixed (100+ RU/s)10%–100% of configured max
ScalingAutomatic burstManual adjustmentAutomatic within range
Minimum cost$0 when idleAlways pay for provisioned RU/sPay for 10% of max when idle
RegionsSingle region onlyMulti-region supportedMulti-region supported
SLASLA with availability zones (single-region)99.99% / 99.999%99.99% / 99.999%
Storage limit50 GB per logical partition (same as provisioned)UnlimitedUnlimited
Best forDev/test, low/sporadic trafficPredictable, steady workloadsVariable but somewhat predictable traffic

Serverless deep dive

Serverless pricing:
  - Pay per RU consumed (not provisioned)
  - 5,000 RU/s per physical partition (scales with partitions)
  - Single region only
  - SLA with availability zones in designated regions
  - 50 GB per logical partition (standard Cosmos DB limit)
  - Can convert to provisioned throughput (NoSQL API)

Marcus’s choice: Serverless for dev/test β€” zero cost when idle, no SLA needed.

Autoscale deep dive

Autoscale example:
  Max RU/s configured: 10,000
  Minimum (10%): 1,000 RU/s
  
  Idle hours: billed at 1,000 RU/s
  Peak hours: scales up to 10,000 RU/s as needed
  
  Cost savings vs manual 10,000 RU/s:
    If traffic is at 10% for 16 hours/day β†’ ~50% cost reduction

Marcus’s choice: Autoscale for production β€” handles the 2Γ— market-hours spike automatically.

πŸ’‘ Exam tip: autoscale minimum is 10%

Autoscale always provisions at least 10% of the maximum. If you set max = 10,000 RU/s, the minimum is 1,000 RU/s β€” you always pay for at least 1,000 even when completely idle. This is why serverless is cheaper for truly sporadic workloads.

The exam tests this: β€œA developer sets autoscale max to 100,000 RU/s. What’s the minimum billed throughput?” β†’ 10,000 RU/s.

Cost factors beyond throughput

FactorCost ImpactOptimisation
Multi-regionMultiply RU/s cost by number of write regionsUse read replicas, not multi-write, unless needed
ConsistencyStrong/Bounded = 2Γ— read RUUse Session for most workloads
IndexingMore indexed paths = higher write RUExclude unused paths
Document sizeLarger docs = more RU per operationKeep documents lean
Cross-partition queriesFan-out multiplies costDesign for single-partition queries

TTL for automatic cleanup

TTL (Time to Live) automatically deletes expired documents β€” no background jobs needed:

// Enable TTL on the container (allow per-item TTL)
ContainerProperties props = new ContainerProperties("sessions", "/userId")
{
    DefaultTimeToLive = -1  // container TTL enabled, no default expiry
};

// Set TTL per item (in seconds)
var session = new {
    id = "session-123",
    userId = "user-456",
    data = "...",
    ttl = 3600  // expire after 1 hour
};
Container TTLItem TTLBehaviour
Not setAnyTTL disabled for entire container
-1Not setItems never expire (opt-in per item)
-13600Item expires after 1 hour
86400Not setItems expire after 1 day (container default)
864003600Item expires after 1 hour (item overrides container)

Cost benefit: Expired documents free storage and reduce backup costs. For provisioned throughput accounts, TTL deletes use leftover RUs not consumed by user requests (no extra billing). For serverless accounts, TTL deletes are charged at the same RU rate as explicit delete operations.

Reserved capacity

For long-term predictable workloads, reserved capacity offers significant discounts:

TermDiscount
1 year~20% off pay-as-you-go
3 years~30% off pay-as-you-go

Marcus’s choice: 3-year reservation for production (predictable baseline), autoscale for the spike portion.

🎬 Video walkthrough

🎬 Video coming soon

Cost Optimization β€” DP-420 Module 26

Cost Optimization β€” DP-420 Module 26

~16 min

Flashcards

Question

What is the minimum billing for autoscale at max 10,000 RU/s?

Click or press Enter to reveal answer

Answer

1,000 RU/s (10% of the maximum). Autoscale always provisions at least 10% of the configured max. Even when completely idle, you pay for the 10% floor.

Click to flip back

Question

What are key characteristics of serverless Cosmos DB?

Click or press Enter to reveal answer

Answer

1) Single region only. 2) 5,000 RU/s per physical partition (scales with more partitions). 3) SLA available with availability zones. Can now convert to provisioned throughput (NoSQL API). No dedicated gateway or integrated cache.

Click to flip back

Question

Do TTL-expired document deletions consume RU/s?

Click or press Enter to reveal answer

Answer

For provisioned throughput, TTL deletions use leftover RUs not consumed by user requests β€” no extra billing, but they compete for capacity. For serverless, TTL deletes are charged at the same RU rate as explicit delete operations.

Click to flip back

Question

Which consistency levels increase read cost?

Click or press Enter to reveal answer

Answer

Strong and Bounded Staleness β€” both cost 2Γ— RU for reads. Session, Consistent Prefix, and Eventual cost 1Γ— (standard). Choosing a weaker consistency level saves money on read-heavy workloads.

Click to flip back

Knowledge Check

Knowledge Check

Marcus's staging environment is used 8 hours/day and completely idle for 16 hours. Currently provisioned at 5,000 RU/s (manual). What's the most cost-effective change?

Knowledge Check

A developer configures autoscale with max 50,000 RU/s. During off-peak hours, traffic drops to near zero. What throughput is billed?

Knowledge Check

Marcus wants to reduce storage costs for his session data that's only relevant for 24 hours. What should he configure?


Next up: DevOps β€” Infrastructure as Code with Bicep/ARM, deployment patterns, and CI/CD pipelines for Cosmos DB.

← Previous

Data Security: Encryption, Keys, and RBAC

Next β†’

DevOps: Infrastructure as Code and Deployments

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.