ApiaryActive
Try: pause · settings · learn · wipe
← Community / Reading Room
MA
computing · 3 min read

Microsoft Azure Cosmos Db

Microsoft Azure Cosmos DB is a globally distributed, multi-model, NoSQL database service provided by Microsoft as part of its Azure cloud computing platform.…

Microsoft Azure Cosmos DB is a globally distributed, multi-model, NoSQL database service provided by Microsoft as part of its Azure cloud computing platform. Launched in 2017 (following its predecessor, Azure DocumentDB, introduced in 2014), Cosmos DB is designed to support high availability, low latency, and horizontal scalability for applications requiring global reach and elastic scaling. It serves as a fully managed service, eliminating the need for infrastructure management, and offers compatibility with multiple data models and APIs.

Architecture and Key Features

Azure Cosmos DB is built on a distributed architecture optimized for global scale, enabling data replication across multiple geographic regions. Its core design principles include automatic sharding, which partitions data into logical units based on a user-defined partition key, and multi-region replication, which ensures redundancy and fault tolerance. The service supports five consistency levels—strong, bounded staleness, session, consistent prefix, and eventual—allowing users to balance consistency, availability, and latency according to their application needs.

Key features include:

  • Global distribution: Data can be replicated across up to 100 regions globally, with automatic failover and geo-redundant backups.
  • Multi-model support: Cosmos DB supports document, key-value, graph, and wide-column (table) data models through APIs compatible with MongoDB, Cassandra, Azure Table Storage, Graph (Gremlin), and its native SQL API.
  • Schema-agnostic design: Data is stored as JSON, with schema flexibility and automatic indexing.
  • Autoscaling and throughput control: Users can configure provisioned throughput (measured in Request Units per second, or RU/s) or opt for autoscaling to handle variable workloads.

Data Models and APIs

Cosmos DB abstracts data storage through a unified API while accommodating diverse data models:

  • Document model: JSON documents stored in collections, accessed via the SQL API.
  • Graph model: Vertices and edges represented using Gremlin (Apache TinkerPop) queries.
  • Key-value model: Optimized for high-throughput, low-latency operations via the Table API or MongoDB API.
  • Wide-column model: Column-family data structures via the Cassandra API.

Each API provides language-specific SDKs (e.g., .NET, Python, Java) and integrates with Azure tools like Logic Apps, Functions, and DevOps pipelines. The service’s query engine supports declarative querying with SQL-like syntax, graph traversal, or native protocols for MongoDB and Cassandra.

Performance and Scalability

Azure Cosmos DB guarantees single-digit millisecond latency at the 99th percentile and 99.99% availability under standard service level agreements (SLAs). Throughput scaling is achieved via RU/s, a capacity unit that accounts for CPU, memory, and I/O resources. Users can allocate RU/s per database, container, or partition, with autoscaling adjusting capacity dynamically based on demand.

Partitioning is central to Cosmos DB’s scalability: data is divided into logical partitions, each capable of handling up to 10 GB of storage and 10,000 RU/s. For unbounded growth, the service supports unlimited storage by splitting partitions as data volumes expand. Additionally, the Change Feed feature enables real-time data processing by tracking modifications across partitions.

Use Cases and Applications

Cosmos DB is widely adopted in scenarios demanding global scalability and low-latency access, such as:

  • IoT platforms: Storing and analyzing telemetry data from distributed sensors.
  • Gaming services: Managing player profiles, leaderboards, and session data with low latency.
  • Content delivery networks (CDNs): Caching and retrieving assets from edge locations.
  • E-commerce applications: Supporting global inventory tracking and personalized recommendations.

Notable clients include Fortune 500 companies and startups leveraging Cosmos DB for mission-critical workloads. Its compatibility with Azure Functions and Event Hubs also makes it suitable for serverless architectures and real-time analytics pipelines.

Pricing and Availability

Azure Cosmos DB pricing is usage-based, with charges for data storage, throughput (RU/s), and data transfer (in/out). Users can choose between provisioned throughput, autoscaling throughput, or a serverless model (pay-per-request). Serverless billing charges only for actual requests, with no upfront capacity commitments.

The service is available in all Azure regions, with regional availability varying by API (e.g., Cassandra API is not available in all regions). Azure offers a free tier for developers

Frequently asked
What is Microsoft Azure Cosmos Db about?
Microsoft Azure Cosmos DB is a globally distributed, multi-model, NoSQL database service provided by Microsoft as part of its Azure cloud computing platform.…
What should you know about architecture and Key Features?
Azure Cosmos DB is built on a distributed architecture optimized for global scale, enabling data replication across multiple geographic regions. Its core design principles include automatic sharding, which partitions data into logical units based on a user-defined partition key, and multi-region replication, which…
What should you know about data Models and APIs?
Cosmos DB abstracts data storage through a unified API while accommodating diverse data models:
What should you know about performance and Scalability?
Azure Cosmos DB guarantees single-digit millisecond latency at the 99th percentile and 99.99% availability under standard service level agreements (SLAs). Throughput scaling is achieved via RU/s, a capacity unit that accounts for CPU, memory, and I/O resources. Users can allocate RU/s per database, container, or…
What should you know about use Cases and Applications?
Cosmos DB is widely adopted in scenarios demanding global scalability and low-latency access, such as:
References & sources
  1. Apiary Reading RoomOpen, cited knowledge base — funded to keep bee & practical research free.
From the Apiary Reading Room. Opinion & editorial — not financial advice. We don't overclaim.
More from the Reading Room