Comparing Microsoft Cosmos DB And MongoDB (2024)

EventLast call on early bird discount! Get your ticket to MongoDB.local London. Register now >>

Cosmos DB is a proprietary NoSQL database offered by Microsoft as a managed service on its Azure cloud platform. Originally launched as DocumentDB in 2015, the service got very little developer adoption and was relaunched as Cosmos DB in 2017. In an attempt to gain market traction, Microsoft began offering developers several APIs to work with data, including an imitation of the MongoDB API.

Cosmos DB is positioned as providing a globally scalable, multi-model database supporting operational applications. It borrows many concepts from MongoDB, but falls short in compatibility and functionality. For example, you can only query data using a single model. If you provision a container with the SQL API, you cannot query it with the Cosmos DB emulation API. Cosmos DB also does not support time-series data. MongoDB, on the other hand, lets you run key-value, graph, and SQL queries against the same data. And, with MongoDB 5.0, you can build and run applications with support for specific time-series data storage and query patterns.

Both MongoDB (through MongoDB Atlas) and Cosmos DB are available as fully managed, global database services on Azure. However, MongoDB provides much richer functionality to support a broader range of use cases and, crucially, more deployment flexibility, eliminating lock-in to any one cloud provider, especially with multi-cloud clusters. Cosmos DB can only be run as a managed service on Azure, requiring a full-scale migration if users ever want to run on another cloud provider.

The chart below shows how the different options stack up.*

*As of November 2023

MongoDBMicrosoft Cosmos DB Emulation API
Choice of cloud providers

Yes

AWS, Azure & Google Cloud, including multi-cloud clusters spanning all three cloud platforms

No
Integrated text search, geospatial processing

Yes

Limited

Some support for geospatial data, but with limited indexing

Supports all MongoDB features with full application compatibility

Yes

Runs native MongoDB

No

Claims compatibility with v4.2 API, actually closer to 3.6

No MongoDB server-side code

Fails over 67% of compatibility tests

Access to the latest MongoDB version

Yes

Run the latest release of MongoDB or any supported previous versions

No

Claims compatibility with v4.2 API; many features not supported, some with significant limitations

Free tier

Yes

Storage: 512 MB; RAM: Variable

Limited

Just for the first 400 RU/s. Not sandboxed, so no way to avoid cost if usage increases beyond the 400RU/s limit

Live migrationYes Only for eligible accounts
Choice of instance configuration

Yes

Multiple instance sizes and classes

No

Configuration based on provisioned throughput. No way to independently select underlying hardware configurations

Support for MongoDB multi-document ACID transactions Yes

Limited

Multi-document transactions are supported only within a single, unsharded collection; fails almost all of MongoDB's transaction tests

JSON data type support

BSON (Binary JSON)

Regular JSON + longs, doubles, floats, decimal, dates, and times

BSON

Some data types have restrictions, including the inability to modify them once set

Maximum document size

16 MB

2 MB
JSON schema for data governance controls

Yes

No

All schema controls must be written in the app tier

Integrated text search and graph queries

Yes

MongoDB aggregation pipeline and Atlas Search

No integrated text search
Integrated querying of data in cloud object storage

Yes

Atlas Data Federation

No

Online archive
Automatically tier data out from database to cloud object storage

Yes

Online Archive

No

Blend data with joins and unions for analytics queries

Yes

No

Automatic performance recommendations

Yes

Performance Advisor with schema and index recommendations

No

Replica set configuration

Up to 50 replicas by default; expandable upon request

All replicas configured as data-bearing nodes

3 data-bearing nodes
Automatic sharding support

Yes

Scale writes horizontally across multiple nodes. Store multiple TB of data on a single shard.

Ability to refine shard key as application requirements evolve.

Yes

However, no support to refine the chosen shard key, forcing a full database migration should the shard key need to change in any way.

Hedged reads
Queries submitted to multiple replicas for consistent low latency

Yes

No

Pause and resume clusters

YesNo
Data explorer

Yes

Directly in Atlas UI, or via MongoDB Compass

Yes
SQL-based connectivity

Yes

MongoDB Connector for Business Intelligence

Yes

Native SQL queries require separate instance of Cosmos DB with SQL API; no way to run SQL queries directly against a Cosmos DB instance using the MongoDB imitation API

Power BI and Qlik Sense allow for SQL analytics queries

Native data visualization without 3rd party BI tools

Yes

MongoDB Charts

No
Database supported in on-premise and hybrid deployments

Yes

MongoDB Enterprise Advanced

No
Embeddable database with sync for mobile devices

Yes

MongoDB Atlas Device Sync

No
MongoDB
Choice of cloud providers

Yes

AWS, Azure & Google Cloud, including multi-cloud clusters spanning all three cloud platforms

Integrated text search, geospatial processing

Yes

Supports all MongoDB features with full application compatibility

Yes

Runs native MongoDB

Access to the latest MongoDB version

Yes

Run the latest release of MongoDB or any supported previous versions

Free tier

Yes

Storage: 512 MB; RAM: Variable

Live migrationYes
Choice of instance configuration

Yes

Multiple instance sizes and classes

Support for MongoDB multi-document ACID transactions Yes
JSON data type support

BSON (Binary JSON)

Regular JSON + longs, doubles, floats, decimal, dates, and times

Maximum document size

16 MB

JSON schema for data governance controls

Yes

Integrated text search and graph queries

Yes

MongoDB aggregation pipeline and Atlas Search

Integrated querying of data in cloud object storage

Yes

Atlas Data Federation

Online archive
Automatically tier data out from database to cloud object storage

Yes

Online Archive

Blend data with joins and unions for analytics queries

Yes

Automatic performance recommendations

Yes

Performance Advisor with schema and index recommendations

Replica set configuration

Up to 50 replicas by default; expandable upon request

All replicas configured as data-bearing nodes

Automatic sharding support

Yes

Scale writes horizontally across multiple nodes. Store multiple TB of data on a single shard.

Ability to refine shard key as application requirements evolve.

Hedged reads
Queries submitted to multiple replicas for consistent low latency

Yes

Pause and resume clusters

Yes
Data explorer

Yes

Directly in Atlas UI, or via MongoDB Compass

SQL-based connectivity

Yes

MongoDB Connector for Business Intelligence

Native data visualization without 3rd party BI tools

Yes

MongoDB Charts

Database supported in on-premise and hybrid deployments

Yes

MongoDB Enterprise Advanced

Embeddable database with sync for mobile devices

Yes

MongoDB Atlas Device Sync

Microsoft Cosmos DB Emulation API
Choice of cloud providersNo
Integrated text search, geospatial processing

Limited

Some support for geospatial data, but with limited indexing

Supports all MongoDB features with full application compatibility

No

Claims compatibility with v4.2 API, actually closer to 3.6

No MongoDB server-side code

Fails over 67% of compatibility tests

Access to the latest MongoDB version

No

Claims compatibility with v4.2 API; many features not supported, some with significant limitations

Free tier

Limited

Just for the first 400 RU/s. Not sandboxed, so no way to avoid cost if usage increases beyond the 400RU/s limit

Live migrationOnly for eligible accounts
Choice of instance configuration

No

Configuration based on provisioned throughput. No way to independently select underlying hardware configurations

Support for MongoDB multi-document ACID transactions

Limited

Multi-document transactions are supported only within a single, unsharded collection; fails almost all of MongoDB's transaction tests

JSON data type support

BSON

Some data types have restrictions, including the inability to modify them once set

Maximum document size2 MB
JSON schema for data governance controls

No

All schema controls must be written in the app tier

Integrated text search and graph queriesNo integrated text search
Integrated querying of data in cloud object storageNo

Online archive
Automatically tier data out from database to cloud object storage

No

Blend data with joins and unions for analytics queries

No

Automatic performance recommendations

No

Replica set configuration

3 data-bearing nodes
Automatic sharding support

Yes

However, no support to refine the chosen shard key, forcing a full database migration should the shard key need to change in any way.

Hedged reads
Queries submitted to multiple replicas for consistent low latency

No

Pause and resume clusters

No
Data explorerYes
SQL-based connectivity

Yes

Native SQL queries require separate instance of Cosmos DB with SQL API; no way to run SQL queries directly against a Cosmos DB instance using the MongoDB imitation API

Power BI and Qlik Sense allow for SQL analytics queries

Native data visualization without 3rd party BI toolsNo
Database supported in on-premise and hybrid deploymentsNo
Embeddable database with sync for mobile devicesNo

Global Clusters

MongoDBMicrosoft Cosmos DB Emulation API
Multi-cloud deployment

Yes

Deploy across 110+ AWS, Azure, and Google Cloud regions

No

Cosmos users are limited to Azure availability zones only

Active-active clusters supporting global writes

Low-latency writes from anywhere in the world

Yes

Yes

Risk of data loss due to conflict resolution. Reads can be eventually consistent (returning stale or deleted data)

Cross-region replicationDistribute data around the world for multi-region fault tolerance and local reads

Yes

Yes

Reads can be eventually consistent (returning stale or deleted data)

MongoDB
Multi-cloud deployment

Yes

Deploy across 110+ AWS, Azure, and Google Cloud regions

Active-active clusters supporting global writes

Low-latency writes from anywhere in the world

Yes

Cross-region replicationDistribute data around the world for multi-region fault tolerance and local reads

Yes
Microsoft Cosmos DB Emulation API
Multi-cloud deployment

No

Cosmos users are limited to Azure availability zones only

Active-active clusters supporting global writes

Low-latency writes from anywhere in the world

Yes

Risk of data loss due to conflict resolution. Reads can be eventually consistent (returning stale or deleted data)

Cross-region replicationDistribute data around the world for multi-region fault tolerance and local reads

Yes

Reads can be eventually consistent (returning stale or deleted data)

Monitoring and Disaster Recovery

MongoDBMicrosoft Cosmos DB Emulation API
Automatic scaling of compute and storageYes

Yes

50% upcharge for autoscaling, can only scale within a certain tier

Monitoring of database health with automated alerting

Yes

MongoDB Atlas UI & support for APM platforms (i.e., New Relic)

Partial

Only a limited number of account-level metrics are exposed

Backup snapshots with on-demand Point in Time restoreYesYes
Queryable backupsYesNo
Automated & consistent snapshots of sharded clustersYesNo
MongoDB
Automatic scaling of compute and storageYes
Monitoring of database health with automated alerting

Yes

MongoDB Atlas UI & support for APM platforms (i.e., New Relic)

Backup snapshots with on-demand Point in Time restoreYes
Queryable backupsYes
Automated & consistent snapshots of sharded clustersYes
Microsoft Cosmos DB Emulation API
Automatic scaling of compute and storage

Yes

50% upcharge for autoscaling, can only scale within a certain tier

Monitoring of database health with automated alerting

Partial

Only a limited number of account-level metrics are exposed

Backup snapshots with on-demand Point in Time restoreYes
Queryable backupsNo
Automated & consistent snapshots of sharded clustersNo

Security Controls

MongoDBMicrosoft Cosmos DB Emulation API
Granular role-based access controlYes

Limited

Coarse-grained roles only

AWS VPC PeeringYesN/A
Encryption of data in-flight

Yes

TLS/SSL as standard

Yes
Encryption of data at-restYesYes

Client-side field level encryption
Encryption of data in-use. Data not readable by service provider

YesNo

Queryable Encryption
Data encrypted on the client side can be queried without decryption.

YesNo
LDAP IntegrationYesYes

Database-level auditing
Track DDL, DML, DCL operations

YesYes
Bring your own KMSYes

No

Azure key vault only

MongoDB
Granular role-based access controlYes
AWS VPC PeeringYes
Encryption of data in-flight

Yes

TLS/SSL as standard

Encryption of data at-restYes

Client-side field level encryption
Encryption of data in-use. Data not readable by service provider

Yes

Queryable Encryption
Data encrypted on the client side can be queried without decryption.

Yes
LDAP IntegrationYes

Database-level auditing
Track DDL, DML, DCL operations

Yes
Bring your own KMSYes
Microsoft Cosmos DB Emulation API
Granular role-based access control

Limited

Coarse-grained roles only

AWS VPC PeeringN/A
Encryption of data in-flightYes
Encryption of data at-restYes

Client-side field level encryption
Encryption of data in-use. Data not readable by service provider

No

Queryable Encryption
Data encrypted on the client side can be queried without decryption.

No
LDAP IntegrationYes

Database-level auditing
Track DDL, DML, DCL operations

Yes
Bring your own KMS

No

Azure key vault only

Support and Services

MongoDBMicrosoft Cosmos DB Emulation API
Database support delivered directly by MongoDB engineers

Yes

Available with an optional support contract

No

Consulting services from engineers with multiple years of MongoDB expertise

Yes

MongoDB Consulting Services

No
MongoDB
Database support delivered directly by MongoDB engineers

Yes

Available with an optional support contract

Consulting services from engineers with multiple years of MongoDB expertise

Yes

MongoDB Consulting Services

Microsoft Cosmos DB Emulation API
Database support delivered directly by MongoDB engineers

No

Consulting services from engineers with multiple years of MongoDB expertiseNo

Get started with MongoDB Atlas today

Comparing Microsoft Cosmos DB And MongoDB (2024)
Top Articles
Where Does Gen 3 1 Tails Spawn
Tqha Yearling Sale 2023 Results
Craigslist Houses For Rent In Denver Colorado
O'reilly's Auto Parts Closest To My Location
Coverage of the introduction of the Water (Special Measures) Bill
Asian Feels Login
Craigslist Motorcycles Jacksonville Florida
Ds Cuts Saugus
Insidious 5 Showtimes Near Cinemark Tinseltown 290 And Xd
Meer klaarheid bij toewijzing rechter
Eric Rohan Justin Obituary
Polyhaven Hdri
Holly Ranch Aussie Farm
Heska Ulite
Hello Alice Business Credit Card Limit Hard Pull
Myunlb
Aita Autism
My.doculivery.com/Crowncork
Craigslist Cars Nwi
Help with Choosing Parts
Swedestats
Dumb Money, la recensione: Paul Dano e quel film biografico sul caso GameStop
Troy Bilt Mower Carburetor Diagram
Craigslist Toy Hauler For Sale By Owner
Osborn-Checkliste: Ideen finden mit System
Scotchlas Funeral Home Obituaries
Wgu Academy Phone Number
The best brunch spots in Berlin
Wiseloan Login
Breckiehill Shower Cucumber
Regina Perrow
Student Portal Stvt
Urbfsdreamgirl
Dashboard Unt
Shelby Star Jail Log
Hannah Jewell
Myra's Floral Princeton Wv
Ludvigsen Mortuary Fremont Nebraska
Housing Intranet Unt
How much does Painttool SAI costs?
The Banshees Of Inisherin Showtimes Near Reading Cinemas Town Square
Lake Kingdom Moon 31
18006548818
Charli D'amelio Bj
Gabrielle Abbate Obituary
Nearest Wintrust Bank
Kaamel Hasaun Wikipedia
Crigslist Tucson
Espn Top 300 Non Ppr
Spn 3464 Engine Throttle Actuator 1 Control Command
Inside the Bestselling Medical Mystery 'Hidden Valley Road'
Stone Eater Bike Park
Latest Posts
Article information

Author: Prof. An Powlowski

Last Updated:

Views: 6138

Rating: 4.3 / 5 (64 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Prof. An Powlowski

Birthday: 1992-09-29

Address: Apt. 994 8891 Orval Hill, Brittnyburgh, AZ 41023-0398

Phone: +26417467956738

Job: District Marketing Strategist

Hobby: Embroidery, Bodybuilding, Motor sports, Amateur radio, Wood carving, Whittling, Air sports

Introduction: My name is Prof. An Powlowski, I am a charming, helpful, attractive, good, graceful, thoughtful, vast person who loves writing and wants to share my knowledge and understanding with you.