MongoDB Atlas vs. CosmosDB: An Holistic Databases-as-a-Service Benchmark Report (2023)
MongoDB Atlas and CosmosDB are two of the most popular Database-as-a-Service (DBaaS) products on the market. But which is the better one for your requirements?
In this article, we will perform a deep and comprehensive qualitative and quantitative benchmark of these two DBaaS products.
We'll discuss the differences, benefits and technical aspects to give you the information you need to make an informed decision.
See what our holistic benchmarking analysis revealed.
An Introduction to DBaaS, MongoDB Atlas and CosmosDB
Database-as-a-Service (DBaaS)
DBaaS is a software-as-a-service solution that provides users with a hosted and fully managed database without having to worry about infrastructure, backup, updates and security. Database-as-a-Service offers companies advantages in scalability, agility and cost savings compared to self-managed databases.
For more information on Database-as-a-Service, including a listing of more than 170 DBaaS products, see this detailed Introduction to DBaaS.
MongoDB Atlas
MongoDB Atlas is the fully managed Database-as-a-Service product from MongoDB, one of the leading document-based NoSQL databases. MongoDB Atlas is available in two products - on dedicated resources, or as an auto-scaling serverless solution. Both products are not based on the open-source version of MongoDB, but on the enterprise-featured commercial version. This is an advantage to many other MongoDB DBaas products.
CosmosDB:
CosmosDB is a proprietary, distributed database solution from Microsoft, which is offered exclusively as DBaaS. It offers different query interfaces e.g. for MongoDB, Apache Cassandra or PostgreSQL. CosmosDB offers an extensive range of different APIs for this purpose. With CosmosDB you do not book a resource size, but a promised number of database operations. CosmosDB is now also available as an auto-scaling product as an alternative.
In this article we focus on the MongoDB API of CosmosDB.
Holistic Benchmarking Analysis: MongoDB vs CosmosDB
Our holistic DBaaS Navigator benchmarking concept looks at 5 dimensions:
Deployment: This includes all technical features and resources offered by the DBaaS products. For each database technology, we look at 18-22 different attributes and evaluate them individually according to their characteristics.
Management: The management block includes the evaluation of the tooling, but also factors of usability and integration into existing systems as well as legal aspects in 9 attributes.
Support: In the support chapter, the various support plans are categorized and compared in detail - as are the service level agreements and objectives.
Performance: The special area of benchANT with comparable performance measurements of identical resources and workloads. Depending on the database, several measurements exist.
Pricing: Calculation of comparable monthly costs for a selected resource size (identical to performance measurements), analysis of payment terms and a price/performance calculation.
All data in this article can be found updated and interactively weighted in the DBaaS Navigator.
The biggest difference on a technical level between MongoDB Atlas and CosmosDB is the operating model. While you book dedicated instance sizes or resource types with MongoDB Atlas, CosmosDB runs an operation-based model where the number and type of database operations decide.
Furthermore, MongoDB Atlas is not only available on Microsoft Azure Cloud, but is additionally available on AWS and Google Cloud. Besides, CosmosDB only supports up to MongoDB version 4.0, this means modern query features for e.g. Time Series are missing. The remaining technical features are almost identical.
In terms of management features, both DBaaS offerings provide outstanding solutions and also score well in terms of compliance and community. Only in terms of EU-GDPR compliance do both companies have to make concessions.
In the Support Options, we see MongoDB Atlas slightly ahead, as better support and SLA terms are offered here, especially in the Basic Support categories. The differences are smaller in the more expensive Premium and Enterprise support.
The Performance measurements performed with the identical workload show slight advantages in operations per second for MongoDB, while CosmosDB scores with lower and more stable latencies.
The big difference becomes apparent in the Price & Price/Performance areas. Operation-based pricing is significantly more expensive for the selected standard workload. A required, detailed discussion of this can be found in the pricing chapter.
Result
In the holistic benchmarking analysis of MongoDB Atlas vs CosmosDB, MongoDB Atlas thus emerges as the easy point winner in our view.
Technical Deployment Features in Detail: MongoDB Atlas vs CosmosDB
MongoDB Atlas is not only available on Microsoft Azure like CosmosDB, but also on AWS and Google Cloud. This allows for more flexible cloud integration and a larger number of selectable regions.
While with MongoDB-Atlas you select dedicated resource sizes, with CosmosDB you book the provisioned database operations. (Note: The serverless variants are not considered here). While in the resource-based case you have to measure the performance of the respective resources, in the operation-based case you have to know exactly your workload.
With MongoDB Atlas the database version and storage type are freely configurable, while this is not possible with CosmosDB and the default settings have to be used.
Both MongoDB Atlas and CosmosDB offer the option of auto-scaling for compute as well as storage.
Neither solution offers freely configurable database settings or database auto-tuning.
MongoDB Atlas as well as CosmosDB offer important security features such as private networking, TLS/SSL and disk encyrption.
Management Details: MongoDB Atlas vs CosmosDB
CosmosDB and MongoDB Atlas both offer the main interfaces for interacting with the DBaaS instance - from WebUI, to a REST API and CLI, to SDKs and Terraform automations.
MongoDB Atlas and CosmosDB offer both scheduled and continuous backups, system monitoring and configurable alerting.
The documentation for MongoDB Atlas, on the other hand, is significantly more detailed than that for CosmosDB.
From an EU GDPR perspective, both DBaaS products should be rated the same, as they are US companies and the DBaaS can only be deployed on US clouds. (Keyword: US Cloud Act).
- CosmosDB provides more compliance certifications, but the community around MongoDB Atlas is significantly larger and more satisfied with the product, which is evident from the reviews and GitHub activities.
Support & SLA Comparison: MongoDB Atlas vs CosmosDB
Both Database-as-a-Service products offer 4 levels of support - from a free support plan to a premium support plan. It should be noted that the support plan for CosmosDB is not a dedicated DBaaS plan, but applies generally to all Microsoft Azure products.
Prices range from $29 per month to $1,000 per month for paid support levels.
Both MongoDB Atlas and CosmosDB divide their support commitments by comparable difficulty levels.
MongoDB Atlas and CosmosDB both guarantee 99.995% availability as SLA targets. However, CosmosDB must be distributed across multiple Availability Zones to achieve this, otherwise only 99.9% availability is guaranteed.
Both Database-as-a-Service providers offer migration solutions and professional services around their product.
The detailed services per support plan can be found in the DBaaS Navigator. For the low-cost support plans, MongoDB Atlas offers slightly better services than MS Azure. However, the performance is similar for the more expensive Enterprise and Premium support plans.
Results of the Performance Measurements: MongoDB Atlas vs CosmosDB
- The performance measurements were performed with the identical mixed workload with 50% write and 50% read operations and 5 kB data set size. All details can be found publicly in the GitHub repository for DBaaS Navigator.
For MongoDB Atlas, 3x M50 (8x32 GB RAM VMs) on AWS were used. For CosmosDB, 5.625 write and read operations per second each were posted. This is 75% of MongoDB Atlas performance and serves as a reference value since a 1:1 comparison at the resource level is not possible.
The performance measurements show that CosmosDB actually delivers the posted operations per second.
At the same time, CosmosDB also shows significantly lower write and read latencies, each in very good ranges in the low millisecond range.
The stability of the results is more than satisfactory for both DBaaS offerings. Only the read-latency stability of MongoDB Atlas with deviations of up to 23% stands out negatively here.
Pricing Comparison: MongoDB Atlas vs CosmosDB
Based on the resource size of the performance measurements, the monthly costs including storage, backup, network and support were calculated. This shows clear price advantages for MongoDB Atlas, as CosmosDB has significantly higher prices for a comparable throughput or RUs (request units). The monthly cost for MongoDB Atlas is only $1,900, compared to over $9,000 for CosmosDB.
If you put the monthly prices in relation to the throughput values, you get a clear price-performance winner with MongoDB Atlas.
The prices for CosmosDB can still be reduced by approx. 40-50% through long-term bookings, this is not possible with MongoDB Atlas via the web interface.
The cost of CosmosDB's auto-scaling feature is also 1.5 times more expensive than the dedicated standard pricing. With MongoDB Atlas, the autoscaling feature is already included at no additional charge.
Summary
MongoDB Atlas and CosmosDB are two excellent NoSQL databases-as-a-service solutions. MongoDB Atlas impresses as a multi-cloud capable DBaaS with a large community. CosmosDB's advanced operations-based business model delivers top performance results, but is much more expensive than MongoDB Atlas for the chosen workload.
More details on the complex support levels as well as further measurement results can be found in the DBaaS Navigator.
For individual and detailed consulting, as well as application specific performance measurements or "Total Costs of Ownership calculation", please contact us. Besides MongoDB Atlas and CosmosDB, benchANT also offers holistic, individual consulting as well as migration for many other Database-as-a-Service products.