DP-900 Deep Dive

Azure Cosmos DB vs Azure SQL Database: Complete DP-900 Comparison

The most commonly tested DP-900 question type: "Given this scenario, should you use Cosmos DB or Azure SQL?" Here's how to answer it every time.

By MSCertQuiz TeamUpdated March 202616 min read

Why This Topic Matters for DP-900

The DP-900 exam heavily tests service selection scenarios. "Which Azure database service should you use for X requirement?" questions appear multiple times. The Cosmos DB vs Azure SQL comparison is the single most common version of this question. Mastering this comparison alone can answer 5–8 exam questions.

The Fundamental Difference: Relational vs Non-Relational

Azure SQL Database and Azure Cosmos DB represent two fundamentally different database paradigms. Understanding the paradigm difference is more important than memorizing feature lists.

Azure SQL Database

A fully managed relational database (RDBMS) built on Microsoft SQL Server. Data is stored in tables with fixed schemas, relationships defined by foreign keys, and transactions that follow ACID principles.

Data model: Tables, rows, columns

Schema: Fixed — defined upfront

Query language: T-SQL (Transact-SQL)

Consistency: Strong ACID transactions

Scale: Vertical + limited horizontal

Azure Cosmos DB

A fully managed multi-model NoSQL database designed for global distribution and massive scale. Data models vary by API — documents, key-value, column-family, or graph.

Data model: Documents, key-value, graph, column

Schema: Flexible — schema-agnostic

Query language: Varies by API (SQL-like, Gremlin, etc.)

Consistency: 5 configurable consistency levels

Scale: Horizontal by design, global distribution

Feature Comparison Table

FeatureAzure SQL DatabaseAzure Cosmos DB
Data ModelRelational (tables)Multi-model (document, key-value, graph, column)
Schema FlexibilityFixed schema requiredFlexible / schema-agnostic
Global DistributionRequires geo-replication (manual setup)Built-in, click-to-add regions
ReplicationActive geo-replication (read replicas)Multi-region writes (active-active)
ConsistencyStrong (ACID) only5 levels: Strong to Eventual
Latency GuaranteeNo SLA on latency<10ms reads, <15ms writes (99th percentile)
Throughput ModelDTU or vCore (compute-based)Request Units (RU/s) — throughput-based
PartitioningManual sharding or elastic poolsAutomatic partitioning via partition key
Query LanguageT-SQL (full SQL support)SQL API, Gremlin, MongoDB, Cassandra, Table
JoinsFull JOIN support across tablesNo cross-partition joins (denormalize instead)
ACID TransactionsFull multi-table transactionsWithin single partition only
Pricing ModelDTU/vCore + storageProvisioned or serverless RU/s + storage

When to Choose Azure SQL Database

Azure SQL Database is the right choice when your workload has these characteristics:

Use Azure SQL Database when: Structured, relational data

Financial records, inventory systems, HR data — where data has consistent structure, relationships between entities, and requires JOIN operations. If you have foreign keys and referential integrity requirements, use Azure SQL.

Use Azure SQL Database when: ACID transactions across multiple tables

Bank transfers, order processing — where you need to update multiple tables atomically. Azure SQL's transaction support is mature and complete. Cosmos DB only supports transactions within a single partition.

Use Azure SQL Database when: Complex SQL queries

Reporting, analytics on operational data, complex aggregations with GROUP BY, multiple JOINs. Azure SQL supports the full T-SQL dialect including window functions, CTEs, and stored procedures.

Use Azure SQL Database when: Existing SQL Server workloads

Migration from on-premises SQL Server is seamless with Azure SQL Database. Schema compatibility, T-SQL compatibility, and tooling compatibility (SSMS, Azure Data Studio) are all maintained.

Use Azure SQL Database when: OLTP workloads with moderate scale

Transactional applications serving thousands of concurrent users. Azure SQL scales well for typical enterprise OLTP. For web-scale global applications serving millions, Cosmos DB becomes more appropriate.

When to Choose Azure Cosmos DB

Cosmos DB is the right choice when your workload has these characteristics:

Use Cosmos DB when: Global distribution required

Applications serving users across multiple continents where data must be geographically close to users. Cosmos DB allows you to add regions with a checkbox — no complex setup. Azure SQL requires configuring read replicas and handling failover manually.

Use Cosmos DB when: Massive scale with low latency SLA

Cosmos DB guarantees single-digit millisecond reads and 15ms writes at the 99th percentile globally. This is an SLA, not a best-effort promise. Use Cosmos DB for IoT, gaming leaderboards, and real-time applications where latency matters at scale.

Use Cosmos DB when: Variable or evolving schema

Product catalogs where different products have different attributes. User profiles with optional fields. Event data with varying structures. When you can't define a fixed schema upfront, Cosmos DB's schema-agnostic nature is a fundamental advantage.

Use Cosmos DB when: Internet-scale key-value lookups

Session state, user preferences, shopping carts — simple lookups by a known key with extremely high throughput. Cosmos DB's horizontal partitioning makes this trivially scalable.

Use Cosmos DB when: Graph relationships

Social networks, recommendation engines, fraud detection — where the relationships between data points are as important as the data itself. Use the Gremlin API for graph queries.

Cosmos DB APIs: Which One for Which Scenario?

Cosmos DB's multi-API support is a major DP-900 exam topic. The exam tests whether you can select the right API for a given scenario.

APIData ModelUse When
NoSQL (Core/SQL)JSON documentsNew applications needing document storage with SQL-like queries
MongoDBJSON documents (BSON)Existing MongoDB applications migrating to Azure — keep your MongoDB drivers and queries
CassandraColumn-family (wide-column)Existing Cassandra applications, time-series data, large-scale telemetry
GremlinProperty graphSocial networks, recommendation engines, fraud detection — graph traversal queries
TableKey-valueMigrating from Azure Table Storage with need for global distribution and better performance

DP-900 Exam Scenarios: Choose the Right Service

Practice with these scenario-based questions that appear in the DP-900 exam style:

Scenario 1

A retail company has a product catalog where each product has different attributes. A smartphone has storage, RAM, and screen size. A chair has material, weight capacity, and dimensions. The catalog has 5 million products and must support fast lookups by product ID.

Answer: Azure Cosmos DB (NoSQL API)

Variable schema per product type = document database. Fast lookups by product ID = key-value access pattern. 5 million products = scale benefit from Cosmos DB horizontal partitioning.

Scenario 2

A financial application processes 500 transactions per second. Each transaction involves updating a bank account balance, recording a ledger entry, and updating a transaction history record — all three must succeed or all three must fail.

Answer: Azure SQL Database

Multi-table ACID transaction requirement (account + ledger + history) = relational database. Cosmos DB only supports transactions within a single partition. Financial data with strict consistency = strong ACID.

Scenario 3

A gaming company has a leaderboard for a global multiplayer game. Players in Asia, Europe, and North America must see low-latency leaderboard updates. 50,000 concurrent updates per second at peak.

Answer: Azure Cosmos DB (NoSQL API)

Global distribution required = Cosmos DB multi-region. Low-latency SLA = Cosmos DB <10ms reads. High write throughput = Cosmos DB horizontal scale with provisioned RU/s.

Scenario 4

A hospital is migrating its patient records system from SQL Server 2019 on-premises to Azure. The application uses stored procedures, complex JOINs, and SQL Server-specific T-SQL features.

Answer: Azure SQL Database (or SQL Managed Instance)

SQL Server migration with T-SQL compatibility = Azure SQL family. Complex JOINs and stored procedures = relational database. The exam tip: "migrating SQL Server" almost always points to Azure SQL.

Key Decision Framework: The 5 Questions

When you see a DP-900 scenario question about database selection, ask yourself these five questions in order:

1. Does the data have a fixed, consistent schema?

Yes → lean Azure SQL | No → lean Cosmos DB

2. Does the scenario require multi-table ACID transactions?

Yes → Azure SQL | No → either could work

3. Is global distribution across multiple regions required?

Yes → Cosmos DB | No → either could work

4. Does the scenario mention SQL Server migration?

Almost certainly Azure SQL Database or SQL Managed Instance

5. Does the scenario describe graph data, key-value lookups, or document/JSON data?

Almost certainly Cosmos DB with the appropriate API

Practice Cosmos DB vs SQL Scenarios

Our DP-900 question bank includes dozens of service selection scenarios across all 4 domains. Start with 40 questions free.

Start Free DP-900 Practice →

Related Resources