Azure Cosmos DB is a globally distributed, multi-model database service designed for low-latency, elastic scale, and high availability. The core concepts that drive performance and cost are the resource model (accounts β databases β containers β items), partitioning, and throughput (RU/s). This cheat sheet focuses on the API for NoSQL (SQL query language) and the operational features you'll use most: indexing, consistency, search, change feed, backup/restore, and security. Full-text search and hybrid search reached general availability in 2025, making Cosmos DB a search-native database alongside its vector and transactional capabilities.
What This Cheat Sheet Covers
This topic spans 16 focused tables and 149 indexed concepts, 119 flashcards. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.
A jump-to index of every table row in this cheat sheet.
An interactive map of every table and concept in this topic.
Table 1: Resource Model
Everything in Cosmos DB nests in a strict hierarchy β accounts hold databases, databases hold containers, and containers hold the JSON items you actually read and write. Understanding where each thing sits is what makes the later topics (throughput, partitioning, indexing) click, since you provision and configure most features at the container level. The limits and emulator rows give you the hard numbers and the local sandbox you'll lean on while learning.
| Resource | Example | Description | |
|---|---|---|---|
https://<account>.documents.azure.com:443/ | Top-level Azure resource that provides the endpoint, authentication boundary, and global distribution settings for all databases/containers/items underneath. | ||
databaseId = "Sales" | β’ Logical namespace under an account that groups one or more containers β’ throughput can be provisioned at database (shared) or container (dedicated) scope. | ||
containerId = "Orders" | β’ Unit of scalability for items, indexing, and throughput β’ partition key is defined at creation and is immutable in-place. | ||
{ "id": "o-123", "customerId": "c-9" } | β’ JSON document stored in a container β’ uniquely identified by the composite of (partitionKey, id) for the API for NoSQL. | ||
id, _etag, _ts, _rid | β’ System properties support identity, concurrency, and timestamps β’ _etag enables optimistic concurrency; _ts is the last-modified Unix epoch. | ||
max item = 2 MB | β’ Maximum item size is 2 MB (UTF-8 JSON) β’ max partition key value is 2,048 bytes; logical partition max is 20 GB; physical partition max is 50 GB storage and 10,000 RU/s. | ||
docker pull mcr.microsoft.com/cosmosdb/ linux/azure-cosmos-emulator:vnext-preview | β’ Local development environment for testing without an Azure account β’ the Linux-based vNext emulator (preview) runs as a Docker container on Linux, macOS, and Windows with ARM64 support. |