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. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.
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. |