Skip to content
Explainer · Microsoft Azure

Azure Cosmos DB Explained: APIs, Pricing & Use Cases

Azure Cosmos DB is Microsoft's fully managed, globally distributed NoSQL and vector database. This guide explains its APIs (NoSQL, MongoDB, Cassandra, Gremlin, Table) and the related services Microsoft now points to for PostgreSQL and MongoDB workloads, how request units work, the three capacity modes, consistency levels, the lifetime free tier, when to use it instead of Azure SQL, and dated East US prices with worked examples.

Facts checked 8 October 2026 against the providers' official documentation and pricing pages. Next review due January 2027. Cloud services, regions and prices change often; confirm on the provider's site before you buy.
Short answer
  • Cosmos DB is a NoSQL database: you pick an API when you create an account (NoSQL, MongoDB, Cassandra, Gremlin or Table), and data is partitioned and can be replicated to any Azure region.
  • Every operation costs request units (RUs). You pay for RU/s you provision (standard or autoscale) or for RUs you consume (serverless), plus storage per GB in every region.
  • A lifetime free tier gives one account per subscription 1,000 RU/s and 25 GB of storage free; it does not apply to serverless accounts.
  • Microsoft advises against Cosmos DB for highly relational applications and analytical (OLAP) workloads; Azure Cosmos DB for PostgreSQL is on a retirement path.
How we know: Research-based: APIs, request units, capacity modes, consistency and the free tier were checked against Microsoft Learn, and prices against the Azure Cosmos DB pricing pages (autoscale, standard provisioned and serverless) for East US in USD, on 8 October 2026. We have not run Cosmos DB workloads for this guide; the examples are arithmetic on list prices, and real RU consumption depends on your data and queries.

What is Azure Cosmos DB?

Azure Cosmos DB is a fully managed NoSQL and vector database. Microsoft describes single-digit millisecond response times, automatic and instant scaling, turnkey global distribution with multi-region writes and a 99.999% availability SLA, automatic indexing of data, a change feed for event-driven designs, and integrated vector search for AI applications. It stores operational data as documents, key-value items, graphs or tables, depending on the API you choose.

Items in a container are divided into logical partitions by a partition key you choose, which is how Cosmos DB scales containers; Microsoft calls the choice of partition key an important decision for performance, and hierarchical partition keys extend it for multi-tenant designs. You can add or remove Azure regions on an account at any time, and the data is replicated to each.

Azure Cosmos DB APIs

Each Cosmos DB account uses one API, which sets the data model and the wire protocol your drivers speak. The request unit APIs share the same engine, pricing model and features such as global distribution.

Azure Cosmos DB APIs and related services (Microsoft Learn, October 2026)
API or serviceData model and compatibilityStatus and notes
API for NoSQLJSON documents, queried with a SQL-like languageNative API; Microsoft's recommendation for new high-scale NoSQL workloads
API for MongoDB (RU)Documents; MongoDB wire protocol, existing drivers and toolsFor new MongoDB-compatible work Microsoft points to Azure DocumentDB
API for Apache CassandraWide-column; Cassandra driversRU-based pricing
API for Apache GremlinProperty graph (vertices and edges), Gremlin queries on Apache TinkerPopFor OLAP graph work Microsoft points to Graph in Microsoft Fabric
API for TableKey-value tablesRU-based pricing
Azure Cosmos DB for PostgreSQLDistributed PostgreSQL with CitusOn a retirement path, not recommended for new projects; use elastic clusters in Azure Database for PostgreSQL
Azure DocumentDBMongoDB-compatible, built on the open source DocumentDB engine (MIT licence)Separate managed service, recommended by Microsoft for migrating MongoDB applications

Graph database in Azure

If you need a graph database in Azure for operational queries (social graphs, recommendations, connected devices), the API for Apache Gremlin is the managed option. Microsoft's own guidance on that page steers analytical graph work to Graph in Microsoft Fabric instead.

Request units and capacity modes

Cosmos DB normalises the cost of every operation into request units. Microsoft's reference point is that reading a single item of about 1 KB by its ID and partition key costs one RU. Writes, queries, larger items, more indexed properties and stronger consistency all cost more; Microsoft notes that strong and bounded staleness reads consume roughly twice the RUs of the more relaxed levels. Each response reports the RUs it consumed, so you can measure a workload's cost.

  • Standard (manual) provisioned throughput: you set RU/s on a database or container in steps of 100 and are billed hourly for what you provision.
  • Autoscale provisioned throughput: you set a maximum (starting at 1,000 RU/s); throughput scales between 10% and 100% of it, and each hour is billed at the highest RU/s reached, at 1.5 times the standard rate per 100 RU/s.
  • Serverless: no throughput to configure; you pay for RUs consumed and storage. Microsoft recommends it for intermittent, unpredictable traffic, low average-to-peak ratios (under 10%), new applications and integration with Azure Functions.

Consistency levels

Most distributed databases offer only strong or eventual consistency. Cosmos DB offers five levels, from strongest to weakest: strong, bounded staleness, session, consistent prefix and eventual. You set a default on the account and can relax it per request. The choice is a trade-off between read guarantees on one side and latency, availability and RU cost on the other, which matters most when an account spans several regions.

Azure Cosmos DB free tier

The free tier gives the first 1,000 RU/s and 25 GB of storage in an account free for the lifetime of the account. You can have one free tier account per subscription, you must opt in when creating it (it cannot be added later), and it covers provisioned and autoscale throughput but not serverless accounts. Usage beyond the free amounts is billed at normal prices. Microsoft's examples of staying free include one database with up to 1,000 RU/s of shared throughput, or two containers at 400 and 600 RU/s.

Separately, an Azure free account adds 400 RU/s and 25 GB for 12 months, and the Azure Cosmos DB emulator runs locally at no cost for development and testing.

Cosmos DB vs Azure SQL: when to use each

Microsoft lists good fits for Cosmos DB as applications with flexible schemas and fast iteration, latency-sensitive workloads such as real-time personalisation, highly elastic workloads (for example a concert booking platform), high-throughput workloads such as IoT device state, and highly available customer-facing applications. It names two poor fits: analytical workloads, where it suggests Microsoft Fabric, and highly relational applications, where it suggests Azure SQL or Azure Database for MySQL.

In our assessment, choose Azure SQL Database (or Azure Database for PostgreSQL) when your data has many relationships, needs joins and multi-row transactions across tables, or will be queried ad hoc by analysts in SQL. Choose Cosmos DB when access is mostly by key or partition, when you need multi-region writes or very elastic throughput, or when you already use a MongoDB, Cassandra or Gremlin data model. For the general SQL versus document trade-off, see MongoDB vs PostgreSQL and MongoDB vs SQL Server.

Pricing

Prices from the provider's official pricing pages, checked 8 October 2026, region East US, in USD, excluding tax. List prices only; discounts, commitments and your actual usage change the bill.

List prices for request unit accounts (NoSQL, MongoDB RU, Cassandra, Gremlin and Table APIs) from the Azure Cosmos DB pricing pages, General Purpose service tier, single region. Throughput and storage are billed in every region an account is replicated to.

Azure Cosmos DB list prices, East US, checked 8 October 2026
ItemUnitList price
Standard provisioned throughputPer 100 RU/s, single region5.84 USD per month
Autoscale provisioned throughputPer 100 RU/s (billed at 1.5x), single region8.76 USD per month
Serverless request unitsPer 1 million RUs0.25 USD
Transactional storagePer GB per region0.25 USD per month
Periodic backup beyond the 2 free copiesPer GB per copy0.12 USD per month
Continuous backup, 30 or 35 day retentionPer GB per region (7-day retention is free)0.20 USD per month

Small app, standard provisioned throughput

  • One region, 400 RU/s provisioned on a container all month
  • 10 GB of data and indexes
  • Free tier not applied; default periodic backup (two free copies); excludes data egress
ItemBasisEstimated per month
Throughput4 x 5.84 USD (per 100 RU/s)23.36 USD
Storage10 GB x 0.25 USD2.50 USD
Estimated total25.86 USD per month

Variable traffic, autoscale up to 4,000 RU/s

  • One region, autoscale maximum 4,000 RU/s, so it scales between 400 and 4,000 RU/s
  • Assumed average of the hourly billed peaks across the month: 1,500 RU/s
  • 50 GB of data and indexes; excludes data egress
ItemBasisEstimated per month
Throughput15 x 8.76 USD (per 100 RU/s)131.40 USD
Storage50 GB x 0.25 USD12.50 USD
Estimated total143.90 USD per month (range for throughput alone: 35.04 USD at 400 RU/s every hour to 350.40 USD at 4,000 RU/s every hour)

Intermittent prototype on serverless

  • Serverless account, one region
  • 30 million request units consumed in the month
  • 5 GB of data and indexes; free tier does not apply to serverless; excludes data egress
ItemBasisEstimated per month
Request units30 x 0.25 USD (per million RUs)7.50 USD
Storage5 GB x 0.25 USD1.25 USD
Estimated total8.75 USD per month

Worked examples are estimates calculated from the list prices above; they are not quotes or measured bills.

Frequently asked questions

Is Azure Cosmos DB a relational database?

No. It is a NoSQL database for document, key-value, wide-column and graph data. Microsoft recommends Azure SQL or Azure Database for MySQL for highly relational applications, and elastic clusters in Azure Database for PostgreSQL for distributed PostgreSQL.

How is Azure Cosmos DB priced?

By throughput and storage. Provisioned accounts pay per 100 RU/s per hour (standard or autoscale); serverless accounts pay per million RUs consumed. Storage is billed per GB in each region. On 8 October 2026 in East US, standard throughput listed at 5.84 USD per 100 RU/s per month and storage at 0.25 USD per GB per month.

Is Azure Cosmos DB free?

The free tier gives one account per subscription 1,000 RU/s and 25 GB of storage free for the life of the account, if you opt in at creation. It does not apply to serverless accounts. Usage beyond those amounts is billed normally.

What happened to Azure Cosmos DB for PostgreSQL?

Microsoft states it is on a retirement path and no longer recommended for new projects. For PostgreSQL scale-out, Microsoft recommends the elastic clusters feature of Azure Database for PostgreSQL; for NoSQL workloads, Azure Cosmos DB for NoSQL.

Can I use MongoDB drivers with Azure Cosmos DB?

Yes. The API for MongoDB supports the MongoDB wire protocol, so existing drivers, SDKs and tools work, often with only a connection string change. For migrating existing MongoDB applications Microsoft now also points to Azure DocumentDB. See our MongoDB GUI tools guide for client tools.

Sources

Checked 8 October 2026.

How we research cloud database guides: our editorial method. CodeWithSQL earns nothing from the providers mentioned.

Choosing where to run your database?

Start with the section overview, or compare providers side by side.