Exams / DP-900 / D3 Describe considerations for working with non-relational data on Azure
Describe the capabilities and features of Azure Cosmos DB
- Identify use cases for Azure Cosmos DB
- Describe Azure Cosmos DB APIs
What Azure Cosmos DB is for
Azure Cosmos DB is Microsoft's globally distributed, multi-model NoSQL database. It targets workloads that need massive scale, global low-latency access, and flexible (schema-less) data, at guaranteed SLAs:
- Guaranteed reads and writes served in less than 10 milliseconds at the 99th percentile.
- Multi-region writes and data distribution to any Azure region with just a button — every configured region can accept both reads and writes.
- Azure Cosmos DB's schema-less service automatically indexes all your data, regardless of the data model, to deliver blazing fast queries.
Typical scenarios: IoT telemetry ingestion, web/mobile/gaming back ends, catalogs, and any workload that needs massive reads/writes at global scale with low latency.
The account, databases, containers, items
- The account is the top-level resource. You pick its API when you create it — this is the only setting on the whole hierarchy that can be set exclusively at creation time and never changed afterward.
- A database is a logical group of containers (similar to a namespace); it's schema-agnostic.
- A container is the unit of scalability for both storage and throughput. It is horizontally partitioned, and when you create it you must supply a partition key.
- An item belongs to exactly one container, has a partition key value (which puts it in exactly one logical partition) and an item ID unique within that partition. All items in a given logical partition share the exact same partition-key value.
Provisioned throughput
Azure Cosmos DB allows you to set provisioned throughput on your databases and containers — these are the only two levels at which throughput is configured:
| Level | Behavior |
|---|---|
| Container (dedicated) | Reserved exclusively for that container; the recommended default for most workloads |
| Database (shared) | Shared among up to 25 containers in that database |
Items and partitions don't get independently provisioned throughput — partitions simply divide the throughput that's already been provisioned on their container.
What's account-level vs. container-level
| Setting | Level |
|---|---|
| API (NoSQL, MongoDB, Cassandra, Gremlin, Table) | Account — fixed at creation, never changeable |
| Read/write regions, global distribution | Account |
| Default consistency level | Account |
| Partition key | Container — set when the container is created |
| Throughput | Database or container |
| Indexing policy | Container |
The Cosmos DB APIs
| API | Data model | Query language | Notes |
|---|---|---|---|
| NoSQL (Core/SQL) | JSON documents | SQL-like (SELECT/FROM/WHERE) |
Native Cosmos DB API; schema-less, configurable indexing policy per container |
| MongoDB | Documents, BSON format | MQL (MongoDB Query Language) | Wire-compatible with MongoDB drivers |
| Apache Cassandra | Wide-column (column-family) | CQL (Cassandra Query Language) | Rows + columns, partition/clustering keys |
| Apache Gremlin | Graph: vertices and edges | Gremlin traversal language | A Gremlin-API container is the graph itself |
| Table | Key/value, tabular | Table-style access (partition key + row key) | Wire-compatible with Azure Table storage SDKs, plus Cosmos DB's global distribution |
- The SELECT clause belongs to the NoSQL (Core/SQL) API: it identifies and projects fields from JSON documents, following
SELECT/FROM/WHERE, ANSI-SQL style. - The MongoDB API stores documents encoded in BSON and is queried with MQL.
- The Gremlin API models data as property graphs: vertices (nodes) and edges (relationships), each carrying arbitrary key-value properties. A Gremlin container's resource type is projected as a graph.
- The Table API's advantage over plain Azure Table storage is Cosmos DB's multi-region writes (multi-master): every configured region can accept both reads and writes, while Azure Table storage only ever writes to one primary region (even with geo-redundant replication). This is also why the Table API can offer a 10 ms read / 15 ms write SLA versus Table storage's 10-second SLA.
Non-relational data-store models (and which workloads fit them)
| Model | Shape | Optimized for | Typical Azure service |
|---|---|---|---|
| Document | Self-contained JSON per entity, flexible/application-defined schema | High write volume, per-document schema evolution | Cosmos DB for NoSQL / MongoDB |
| Key/value | Unique key → opaque value | Simple lookups (fast get/put by key); sessions, caching, user profiles | Cosmos DB for Table |
| Column-family (wide-column) | Row key + grouped column families | High write throughput, sparse/wide datasets | Cosmos DB for Apache Cassandra |
| Graph | Nodes (entities) + edges (relationships) | Native relationship traversal/analysis — social networks, fraud rings, network/IT topology | Cosmos DB for Apache Gremlin |
| Time-series | Values organized by timestamp | High-ingest timestamped telemetry, trend analysis | IoT sensor readings, monitoring |
| Object | Large binary + mostly-immutable metadata | Whole-object storage: images, backups, documents | Azure Blob storage |
Reliability and global distribution
- Availability Zones give in-region redundancy: they're physically separate datacenter groups within one Azure region, and enabling zone redundancy spreads an account's data replicas across them to survive a single-zone failure.
- Multi-region writes (turnkey, one click per region) give cross-region redundancy and let every configured region serve both reads and writes with a 99.999% read/write availability SLA for multi-region accounts.
- Azure Table storage, by contrast, is active-passive across regions: RA-GRS/RA-GZRS lets a single secondary region serve reads, but all writes always go to the primary region — there is no multi-region write for plain Table storage.
Azure Synapse Link (HTAP)
Azure Synapse Link for Azure Cosmos DB is a cloud-native hybrid transactional and analytical processing (HTAP) capability that enables near real-time analytics over operational data in Azure Cosmos DB. It connects Cosmos DB's analytical store (a column-store copy of the data, kept in sync automatically with no ETL) to Azure Synapse Analytics, so analytical queries run without touching the throughput provisioned for the operational workload.
Exam traps
- "Graph database" questions in this module are not always phrased around Cosmos DB — any node/edge, relationship-centric scenario (org charts, network topology, fraud rings) is testing the graph model even without mentioning Gremlin by name.
- Don't confuse the account-level API choice with anything configurable later: API, once chosen, is permanent — it is the one setting the Cosmos DB resource-provider reference explicitly says "can only be set at database account creation."
- Throughput is database or container, never item or partition — partitions just split a container's already-provisioned throughput.
- Azure Table storage vs. Cosmos DB for Table: both support partitioning (PartitionKey/RowKey) and similar capacity, but only Cosmos DB for Table supports multi-region writes; Table storage's RA-GRS only ever adds a secondary read region.
- "Simple lookups" is the phrase Microsoft uses for key/value stores — don't be tempted by "transactions" or "table joins," which are relational strengths.
- Synapse Link is the HTAP bridge; a Synapse pipeline moves/orchestrates data and a SQL pool is a data-warehouse compute engine — neither alone gives you the no-ETL, near-real-time HTAP capability being tested.
Docs
- Distribute data globally with Azure Cosmos DB
- Azure Cosmos DB use cases
- Azure Cosmos DB for Apache Gremlin overview
- Using a partitioned graph in Azure Cosmos DB
- Reliability in Azure Cosmos DB
- Reliability in Azure Table Storage
- Introduction to provisioned throughput in Azure Cosmos DB
- Provision standard throughput on an Azure Cosmos DB container
- SELECT - Query language in Cosmos DB
- Manage Azure Cosmos DB resources using Azure CLI
- Azure Cosmos DB frequently asked questions
- Databases, containers, and items in Azure Cosmos DB
- Partitioning and horizontal scaling in Azure Cosmos DB
- Indexing policies in Azure Cosmos DB
- Azure Cosmos DB for Table support
- Azure Cosmos DB for Table overview
- Azure Cosmos DB for Table FAQ
- Multi-region writes in Azure Cosmos DB
- Azure Cosmos DB for MongoDB overview
- Azure Cosmos DB for MongoDB 6.0 supported features and syntax
- Azure Cosmos DB for Apache Cassandra overview
- What is Azure Synapse Link for Azure Cosmos DB?
- Azure Cosmos DB introduction
- Graph Database Overview - Microsoft Fabric
- Understand data store models - Azure Architecture Center
- Database Accounts - Create Or Update - Azure Cosmos DB Resource Provider REST API