πŸ”’ Guided

Pre-launch preview. Authorised access only.

Incorrect code

Guided by A Guide to Cloud
Explore AB-900 AI-901
Guided AZ-305 Domain 2
Domain 2 β€” Module 4 of 6 67%
11 of 30 overall

AZ-305 Study Guide

Domain 1: Design Identity, Governance, and Monitoring Solutions

  • Monitoring & Logging Design
  • Choosing Authentication Methods
  • Designing Identity Management
  • Authorizing Access to Resources
  • Secrets, Keys & Certificates
  • Governance at Scale
  • Compliance & Identity Governance

Domain 2: Design Data Storage Solutions

  • Relational Data: Choosing Your SQL Platform
  • Database Performance & Scalability
  • Database Security & Compliance
  • Cosmos DB & Semi-Structured Data
  • Blob, Data Lake & Azure Files
  • Data Integration & Analytics

Domain 3: Design Business Continuity Solutions

  • Recovery Objectives: RPO, RTO & SLA Free
  • Backup & Recovery for Compute Free
  • Backup for Databases & Unstructured Data Free
  • High Availability for Compute Free
  • High Availability for Data Free

Domain 4: Design Infrastructure Solutions

  • Compute Design: VMs & When to Use Them
  • Container Solutions: AKS, ACI & Container Apps
  • Serverless & Batch Processing
  • Messaging Architecture
  • Event-Driven Architecture
  • API Integration & Caching
  • App Configuration & Automated Deployment
  • Migration Strategy & Assessment
  • Executing Migrations
  • Network Connectivity: Internet & Hybrid
  • Network Security & Performance
  • Load Balancing & Routing

AZ-305 Study Guide

Domain 1: Design Identity, Governance, and Monitoring Solutions

  • Monitoring & Logging Design
  • Choosing Authentication Methods
  • Designing Identity Management
  • Authorizing Access to Resources
  • Secrets, Keys & Certificates
  • Governance at Scale
  • Compliance & Identity Governance

Domain 2: Design Data Storage Solutions

  • Relational Data: Choosing Your SQL Platform
  • Database Performance & Scalability
  • Database Security & Compliance
  • Cosmos DB & Semi-Structured Data
  • Blob, Data Lake & Azure Files
  • Data Integration & Analytics

Domain 3: Design Business Continuity Solutions

  • Recovery Objectives: RPO, RTO & SLA Free
  • Backup & Recovery for Compute Free
  • Backup for Databases & Unstructured Data Free
  • High Availability for Compute Free
  • High Availability for Data Free

Domain 4: Design Infrastructure Solutions

  • Compute Design: VMs & When to Use Them
  • Container Solutions: AKS, ACI & Container Apps
  • Serverless & Batch Processing
  • Messaging Architecture
  • Event-Driven Architecture
  • API Integration & Caching
  • App Configuration & Automated Deployment
  • Migration Strategy & Assessment
  • Executing Migrations
  • Network Connectivity: Internet & Hybrid
  • Network Security & Performance
  • Load Balancing & Routing
Domain 2: Design Data Storage Solutions Premium ⏱ ~20 min read

Cosmos DB & Semi-Structured Data

Consistency models, partitioning strategies, and API choices β€” design a globally distributed NoSQL solution that balances performance, consistency, and cost.

Why Cosmos DB design matters

β˜• Simple explanation

Cosmos DB is like a global postal service that guarantees delivery speed β€” but you choose how β€œfresh” the letter needs to be.

It’s Azure’s globally distributed NoSQL database. The three big design decisions: Which API? (NoSQL, MongoDB, Cassandra, Gremlin, Table), Which consistency level? (strong to eventual β€” a tradeoff between correctness and speed), and How to partition? (the partition key determines performance and cost).

Cosmos DB architecture decisions are heavily tested in AZ-305:

  • API selection: NoSQL (native), MongoDB, Cassandra, Gremlin (graph), Table β€” choice depends on existing app investment and data model
  • Consistency models: Five levels from Strong to Eventual β€” each with different latency, throughput, and availability tradeoffs
  • Partitioning: Logical partition key selection directly impacts query performance and cost (RU consumption)
  • Throughput model: Provisioned (manual/autoscale) vs Serverless β€” workload pattern determines choice
  • Global distribution: Multi-region writes vs single-write-multi-read

Cosmos DB consistency models

This is one of the most exam-tested topics in AZ-305. The five consistency levels form a spectrum:

Cosmos DB Consistency Levels
LevelGuaranteeLatencyThroughputBest For
StrongReads always return most recent committed writeHighest (cross-region round-trip)LowestFinancial transactions, inventory counts
Bounded StalenessReads lag behind writes by at most K versions or T timeHighMedium-lowGlobal apps needing near-strong consistency with better perf
Session (default)Reads are consistent within a session (your own writes)MediumMediumMost applications β€” user sees their own updates immediately
Consistent PrefixReads never see out-of-order writesLowMedium-highSocial feeds, activity logs (order matters, staleness is OK)
EventualReads may return older data, eventually convergesLowestHighestView counters, likes, non-critical telemetry

🏦 Elena’s consistency decision: FinSecure’s trading platform needs Strong consistency for account balance reads β€” a trade must see the latest balance. But their customer activity feed uses Session consistency β€” each user sees their own activity immediately, but seeing other users’ activity with a slight delay is acceptable.

πŸ’‘ Exam tip: Session consistency is the default and most common answer

If the exam scenario doesn’t mention a specific consistency requirement, Session is almost always correct. It provides the β€œread your own writes” guarantee that most applications need, with good performance. Choose Strong only when the scenario explicitly mentions β€œmust always read the latest data across all users/regions” β€” and be ready for the performance/cost tradeoff.

API selection

Cosmos DB API Options
APIData ModelQuery LanguageBest For
NoSQLJSON documentsSQL-like queriesNew cloud-native apps, most common choice
MongoDBBSON documentsMongoDB query languageMigrating existing MongoDB applications
CassandraWide-column (tables)CQL (Cassandra Query Language)Migrating Cassandra workloads, high-write IoT
GremlinGraph (vertices + edges)Gremlin traversal languageSocial networks, recommendation engines, fraud detection
TableKey-value pairsOData queriesMigrating Azure Table Storage (better perf + global distribution)

Design rule: Choose the API based on existing application investment, not personal preference. If the app is already built on MongoDB, use the MongoDB API β€” don’t rewrite for NoSQL API. For new apps, NoSQL API is the recommended default.

Partition key design

The partition key is the most important Cosmos DB design decision. A bad partition key causes hot partitions, poor query performance, and wasted RUs.

PrincipleGood ExampleBad Example
High cardinalityuserId (millions of unique values)country (only ~200 values β†’ hot partitions)
Even distributiontenantId (uniform data per tenant)createdDate (all today’s data in one partition)
Query alignmentKey used in most WHERE clausesKey rarely used in queries (forces cross-partition queries)

πŸš€ Marcus’s partition strategy: NovaSaaS uses tenantId as the partition key for most containers β€” queries are always scoped to a tenant, data is evenly distributed, and cross-partition queries are rare.

ℹ️ Design decision: Hierarchical partition keys

For very large datasets, Cosmos DB supports hierarchical partition keys (up to 3 levels). Example: /tenantId/userId/sessionId. This allows:

  • Queries filtered by tenantId β†’ scoped to that tenant’s partitions
  • Sub-filtering by userId β†’ further narrowed
  • Even data distribution across the hierarchy

Use when a single partition key would create partitions that exceed the 20 GB logical partition limit.

Throughput models

Cosmos DB Throughput Options
FactorProvisioned (Manual)Provisioned (Autoscale)Serverless
RU allocationFixed RU/s you setScales between 10% and max RU/sNo pre-allocation β€” pay per request
BillingPer-hour for allocated RU/sPer-hour for the highest RU/s the system scaled to within that hourPer-RU consumed
Minimum cost400 RU/s minimum10% of max (e.g., 400 if max is 4000)Zero when idle
Best forPredictable, steady workloadsVariable workloads with known peaksDev/test, infrequent access, spiky traffic
Max throughputUnlimited (manual scaling)Unlimited (set max)5,000 RU/s per container, 1 TB storage per container

Azure Table Storage vs Cosmos DB Table API

FactorAzure Table StorageCosmos DB Table API
PerformanceVariable latencySingle-digit ms guaranteed
Global distributionSingle region (GRS for DR only)Multi-region active-active
ThroughputPer-partition limitsProvisioned or serverless RU/s
Secondary indexesPrimary key onlyAutomatic indexing on all properties
CostVery lowHigher (premium performance)
Best forSimple key-value, cost-sensitive, low trafficHigh-performance global key-value

Knowledge check

Question

What are the five Cosmos DB consistency levels from strongest to weakest?

Click or press Enter to reveal answer

Answer

Strong β†’ Bounded Staleness β†’ Session (default) β†’ Consistent Prefix β†’ Eventual. Each step down increases throughput and reduces latency but weakens the consistency guarantee.

Click to flip back

Question

What makes a good Cosmos DB partition key?

Click or press Enter to reveal answer

Answer

Three qualities: (1) High cardinality β€” many unique values to distribute data evenly, (2) Even distribution β€” no 'hot' partitions, (3) Query alignment β€” used in most WHERE clauses to avoid expensive cross-partition queries. Example: userId or tenantId.

Click to flip back

Question

When should you choose autoscale RU/s over manual provisioned throughput in Cosmos DB?

Click or press Enter to reveal answer

Answer

Autoscale when traffic is unpredictable or spiky β€” it scales between 10% and 100% of the max RU/s you set, and you pay for peak usage per hour. Manual provisioned when traffic is steady and predictable β€” lower cost but risks throttling during spikes. For dev/test, use serverless (pay per request, no minimum).

Click to flip back

Knowledge Check

πŸš€ NovaSaaS is designing a Cosmos DB container for user session data. Each tenant has 100-10,000 users. Most queries filter by tenant first, then by user. Session data per user is typically 2-5 KB. Which partition key should Marcus recommend?

Knowledge Check

🏦 Elena needs Cosmos DB for a global trading platform. Account balance reads must always return the latest committed write β€” even across regions. Which consistency level should she recommend?

🎬 Video coming soon


Next up: Semi-structured data is designed β€” now let’s handle unstructured data β€” Blob, Data Lake & Azure Files.

← Previous

Database Security & Compliance

Next β†’

Blob, Data Lake & Azure Files

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.