Azure Cosmos DB is Microsoft's globally distributed, multi-model database service for mission-critical applications. Azure Cosmos DB provides turn-key global distribution, elastic scaling of throughput and storage worldwide, single-digit millisecond latencies at the 99th percentile, five well-defined consistency levels, and guaranteed high availability, all backed by industry-leading SLAs. Azure Cosmos DB automatically indexes data without requiring you to deal with schema and index management. It is multi-model and supports document, key-value, graph, and columnar data models.
Cosmos DB databases can be used as the data store for apps written for MongoDB. This means that by using existing drivers, your application written for MongoDB can now communicate with Cosmos DB and use Cosmos DB databases instead of MongoDB databases. In many cases, you can switch from using MongoDB to Cosmos DB by simply changing a connection string. Using this functionality, you can easily build and run MongoDB database applications in the Azure cloud with Azure Cosmos DB's global distribution and comprehensive industry leading SLAs, while continuing to use familiar skills and tools for MongoDB.
What is the benefit of using Azure Cosmos DB for MongoDB applications?
Elastically scalable throughput and storage: Easily scale up or down your MongoDB database to meet your application needs. Your data is stored on solid state disks (SSD) for low predictable latencies. Cosmos DB supports MongoDB collections that can scale to virtually unlimited storage sizes and provisioned throughput. You can elastically scale Cosmos DB with predictable performance seamlessly as your application grows.
Multi-region replication: Cosmos DB transparently replicates your data to all regions you've associated with your MongoDB account, enabling you to develop applications that require global access to data while providing tradeoffs between consistency, availability and performance, all with corresponding guarantees. Cosmos DB provides transparent regional failover with multi-homing APIs, and the ability to elastically scale throughput and storage across the globe. Learn more in Distribute data globally.
MongoDB compatibility: You can use your existing MongoDB expertise, application code, and tooling. You can develop applications using MongoDB and deploy them to production using the fully managed globally distributed Cosmos DB service.
No server management: You don't have to manage and scale your MongoDB databases. Cosmos DB is a fully managed service, which means you do not have to manage any infrastructure or Virtual Machines yourself. Cosmos DB is available in 30+ Azure Regions.
Tunable consistency levels: Select from five well defined consistency levels to achieve optimal trade-off between consistency and performance. For queries and read operations, Cosmos DB offers five distinct consistency levels: strong, bounded-staleness, session, consistent prefix, and eventual. These granular, well-defined consistency levels allow you to make sound trade-offs between consistency, availability, and latency. Learn more in Using consistency levels to maximize availability and performance.
Automatic indexing: By default, Cosmos DB automatically indexes all the properties within documents in your MongoDB database and does not expect or require any schema or creation of secondary indices.
Enterprise grade - Azure Cosmos DB supports multiple local replicas to deliver 99.99% availability and data protection in the face of local and regional failures. Azure Cosmos DB has enterprise grade compliance certifications and security features.
Learn more in this Azure Friday video with Scott Hanselman and Azure Cosmos DB Principal Engineering Manager, Kirill Gavrylyuk.
How to get started
Follow the MongoDB quickstarts to create a Cosmos DB account and migrate your existing Mongo DB application to use Cosmos DB, or build a new one:
- Migrate an existing Node.js MongoDB web app.
- Build a MongoDB API web app with .NET and the Azure portal
- Build a MongoDB API console app with Java and the Azure portal
Information about Azure Cosmos DB's MongoDB API is integrated into the overall Azure Cosmos DB documentation, but here are a few pointers to get you started:
- Follow the Connect to a MongoDB account tutorial to learn how to get your account connection string information.
- Follow the Use MongoChef with Azure Cosmos DB tutorial to learn how to create a connection between your Azure Cosmos DB database and MongoDB app in MongoChef.
- Follow the Migrate data to Azure Cosmos DB with protocol support for MongoDB tutorial to import your data to an API for MongoDB database.
- Connect to an API for MongoDB account using Robomongo.
- Learn how many RUs your operations are using with the GetLastRequestStatistics command and the Azure portal metrics.
- Learn how to configure read preferences for globally distributed apps.