Home › Studies › DP-900 › Non-Relational Data › Azure Cosmos DB

Azure Cosmos DB

Use cases · fit and poor fit · account, container, item · consistency · throughput · NoSQL, MongoDB, Table, Cassandra and Gremlin APIs

By the tools4free.dev team · Last reviewed November 13, 2026

Practice questions for this topic →

What Azure Cosmos DB is

How data is organized

LevelWhat it is
AccountThe top-level Azure resource
DatabaseA logical namespace that groups related containers
ContainerThe primary unit of storage and scaling. You configure the partition key, throughput, indexing policy and optional time-to-live here
ItemAn individual data entity in a container. Depending on the API, items may be called documents, rows, nodes or edges

The partition key distributes data across logical partitions. Each logical partition can hold up to 20 GB of data.

Use cases: good fit and poor fit

WorkloadExampleFit
IoT and telemetryFast ingestion of high-frequency device dataGood
GamingPlayer profiles, leaderboards, in-game statsGood
Retail and e-commerceProduct catalogs, shopping carts, order pipelinesGood
Web and mobile appsPersonalized experiences, social features, third-party integrationsGood
Analytical workloads (OLAP)Interactive, streaming and batch analytics for analysts and data scientistsPoor: consider Microsoft Fabric
Highly relational appsA white-label CRM applicationPoor: consider Azure SQL or Azure Database for MySQL

Good-fit traits listed by Microsoft: flexible schema, latency sensitive, highly elastic, high throughput, and highly available mission critical workloads.

Consistency levels and throughput

Consistency levelMeaning
StrongEvery read reflects the most recent write
Bounded stalenessReads lag behind writes by a configurable interval (time or version count)
SessionConsistency is guaranteed within a single client session; the most widely used level
Consistent prefixReads never see out-of-order writes but may see stale data
EventualReplicas converge over time; the weakest guarantee but the highest availability

Capacity is measured in Request Units per second (RU/s). One RU is roughly the cost of reading a single 1-KB item by its ID and partition key.

Throughput optionDescription
DedicatedProvisioned throughput reserved exclusively for one container
SharedProvisioned at the database level and shared across up to 25 containers
ServerlessNo throughput to provision upfront; you pay for the RUs your requests consume. Best for intermittent, unpredictable traffic. Limited to a single Azure region
AutoscaleYou set a maximum RU/s and Cosmos DB adjusts capacity within that range

The five APIs

When you create an account you choose the API. It sets the data format, the query language and the client libraries your application uses.

APIData modelQuery languageChoose it when
NoSQLJSON documentsSQL-like syntaxYou want the native Cosmos DB API (previously called the SQL API)
MongoDBBSONMongoDB Query Language (MQL)You have MongoDB drivers and expertise
TableKey-value pairs; rows identified by PartitionKey and RowKeyTable Storage programming modelYou have an Azure Table Storage app and want more scale, global distribution and automatic indexing
Apache CassandraColumn-familyCQL (Cassandra Query Language)You migrate an Apache Cassandra workload
Apache GremlinGraph: vertices (nodes) and edgesGremlinConnections between data matter: social networks, recommendations, fraud detection

Azure Cosmos DB for PostgreSQL is a separate offering on a retirement path and isn't recommended for new projects. Azure Table Storage remains available.

Cosmos DB for NoSQL supports Fabric mirroring, which replicates operational data into Microsoft Fabric with no ETL pipeline to build or manage.

Exam Tips

Tick each tip once you can answer it without looking.

“Flexible schema, items with different properties, global low latency” → Azure Cosmos DB. Trap: Azure SQL Database is better suited when an app depends on complex multi-table joins.

“Interactive or batch analytics for analysts (OLAP)” → Poor fit for Cosmos DB; use Microsoft Fabric. Trap: Cosmos DB is an operational NoSQL store.

“Highly relational app, such as a white-label CRM” → Azure SQL or Azure Database for MySQL. Trap: Cosmos DB is listed as a poor fit for highly relational apps.

“Existing MongoDB application, minimal code changes” → Cosmos DB for MongoDB. Trap: NoSQL is the native API with SQL-like queries, not MongoDB drivers.

“Existing Azure Table Storage app needing global distribution” → Cosmos DB for Table. Trap: Table Storage remains available; the Cosmos DB API adds scale, distribution and indexing.

“Entities and relationships, traversals” → Cosmos DB for Apache Gremlin. Trap: Gremlin means vertices and edges, not key-value pairs.

“Migrating an Apache Cassandra workload, CQL” → Cosmos DB for Apache Cassandra. Trap: Cassandra is column-family; Table is key-value.

“"SQL API" in older docs” → Cosmos DB for NoSQL. Trap: It was renamed; it is the same service.

“JSON documents with SQL-like queries” → Cosmos DB for NoSQL. Trap: MongoDB stores BSON and uses MQL.

“Most widely used consistency level” → Session. Trap: Strong is the most recent-write guarantee, Eventual the weakest.

“Pay per RU consumed, nothing provisioned, spiky traffic” → Serverless. Trap: Serverless accounts are limited to a single Azure region.

“Unit of capacity and cost” → Request Unit per second (RU/s). Trap: One RU is about reading a 1-KB item by ID and partition key.

“Where you configure the partition key, indexing policy and (dedicated) throughput” → Container. Trap: A database is a logical namespace that groups related containers; shared throughput can be set at the database level.

“Replicate operational Cosmos DB data into Fabric without ETL” → Fabric mirroring. Trap: You do not build or manage a pipeline for mirroring.

“Cosmos DB for PostgreSQL for a new project” → Not recommended. Trap: It is a separate offering on a retirement path.

Sources

Checked against Microsoft Learn on November 13, 2026.

← Blob, Files & Table StorageNon-Relational Data overview →