Azure Cosmos DB: Global Distribution & Multi-Model Database
Azure Cosmos DB is Microsoft's globally distributed, multi-model database service. It offers comprehensive Service Level Agreements (SLAs) on availability, throughput, storage, and latency, providing elastic and independent scaling of throughput and storage. Cosmos DB transparently partitions and replicates your data across your choice of Azure regions, ensuring high availability and low latency for your applications worldwide.
Key Features
🌎 Global Distribution
Distribute your data across any number of Azure regions. Achieve low latency and high availability for your users anywhere in the world. Turn key and read-write regions on or off with a single click.
Learn More📊 Elastic Scalability
Independently and elastically scale throughput and storage as your application needs grow. Scale on demand with no downtime or performance degradation.
Learn More🔄 Guaranteed SLAs
Benefit from industry-leading, comprehensive Service Level Agreements (SLAs) covering throughput, latency, availability, and consistency.
Learn More🔧 Multi-Model Support
Support for multiple data models including document, key-value, graph, and column-family. Use the API that best suits your application's needs.
Learn More💻 Multiple APIs
Interact with Cosmos DB using familiar APIs: SQL (Core), MongoDB, Cassandra, Gremlin (Graph), and Table.
Learn More🕵️ Tunable Consistency
Choose from five well-defined consistency levels, from strong to eventual, to balance consistency, availability, and latency.
Learn MoreCore Concepts
Understanding Cosmos DB involves grasping its fundamental components:
Resources
The hierarchy of resources in Cosmos DB includes accounts, databases, containers, and items. A container is a schema-agnostic collection of items, analogous to a table in a relational database or a collection in MongoDB.
Throughput
Throughput is provisioned in Request Units per second (RU/s). RU/s is a currency that normalizes the system resources (CPU, memory, IOPS, etc.) required to execute requests against your database.
Partitioning
To achieve elastic scalability, containers are partitioned. Each partition contains a subset of items. A partition key is a property from the item's value that is used to determine the partition. Optimal partitioning is crucial for performance.
// Example of a JSON document in a Cosmos DB container
{
"id": "todo1",
"category": "personal",
"name": "Dentist Appointment",
"description": "See Dr. Smith at 10:00 AM",
"isComplete": false,
"partitionKey": "personal" // Assuming 'category' is the partition key
}
Why Choose Cosmos DB?
- High Availability: Built-in replication ensures data is available even during region failures.
- Low Latency: Data is served from the nearest Azure region, minimizing response times.
- Scalability: Effortlessly scale to handle massive datasets and high traffic volumes.
- Cost-Effectiveness: Pay-as-you-go pricing and various throughput options suit different budgets.
- Developer Productivity: Familiar APIs and SDKs simplify integration.
Common Use Cases
Cosmos DB is ideal for a wide range of applications, including:
- IoT Data: Ingesting and processing massive amounts of telemetry data.
- Web and Mobile Applications: Storing user profiles, sessions, and content.
- Gaming: Storing player data, leaderboards, and game state.
- E-commerce: Managing product catalogs, shopping carts, and order history.
- Real-time Analytics: Powering dashboards and operational intelligence.