Azure Cosmos DB vs MongoDB Atlas: when each one fits
If an Azure commitment or a data residency rule is pushing this decision, Azure Cosmos DB fits best when your estate already runs on Azure and you need multi-region writes. Microsoft documents a 99.999% availability SLA for multi-region writes, with turnkey global distribution and automatic failover, and that guarantee is often the strongest reason to choose the service. Cosmos DB also covers several data models in one managed service: document, vector, key-value, graph and table. Its integrated vector and hybrid similarity search (DiskANN), change feed, and continuous backup with point-in-time restore cover common application needs, and Azure Synapse Link or Fabric mirroring gives analytics access without a separate ETL pipeline. Check the Azure Cosmos DB overview to confirm which features apply to the API you plan to use.
MongoDB Atlas fits when the application is already built on the MongoDB document model, drivers, query language and tooling, and the team wants to keep that code and operational knowledge. Every change to the data model or driver code adds test and rework effort, so an application written against MongoDB APIs keeps its shape on Atlas. Backup and export are also familiar: Atlas cloud backup restores from scheduled and on-demand snapshots, continuous backup or downloaded snapshot files, at collection or database level, and mongodump produces a binary export that restores into deployments on the same major version or feature compatibility version. Confirm which cloud providers and regions Atlas offers for your data before you sign, since that decides residency. Self-managed MongoDB is licensed under the SSPL, which is not OSI-approved, so an open-source exit usually points to FerretDB on PostgreSQL or to Azure DocumentDB, a separate Azure service with MongoDB wire protocol compatibility. Test each option against your own queries and indexes.
The decision turns on three things. First, the data model and driver your application uses. If your code calls MongoDB drivers and aggregation pipelines, Atlas or a MongoDB-compatible option keeps changes small, while code written against Cosmos DB APIs and SDKs ties you to Azure. Second, where data must physically live. Check whether residency rules name specific regions and confirm which regions each option offers for your data. Third, whether the team can accept Azure-only hosting. The Cosmos DB documentation describes no self-hosted edition, and the local emulator is for development and testing, so Azure-only hosting is a lasting condition. Before the renewal, export a sample collection with mongodump, inventory the Cosmos DB APIs and SDK calls in use, and restore a copy in a second environment to see what breaks.
Which path fits: Azure Cosmos DB, MongoDB Atlas or a self-hosted route
The flow starts with the data residency question because it removes options first. If data must stay in your own data center or air-gapped network, the path is self-hosted FerretDB on PostgreSQL. Otherwise, an estate committed to Azure that needs multi-region writes or Azure-native analytics points to Azure Cosmos DB. When neither applies, the MongoDB wire protocol question decides between the self-hosted route and MongoDB Atlas. For Atlas, the final question checks whether the team accepts the Server Side Public License. Confirm each answer with your legal and architecture owners before committing.
Four questions in order lead to one of four outcomes.
Azure Cosmos DB or MongoDB Atlas: which scenario fits your workload
This table matches common workload scenarios to the service that usually fits better, and states the condition under which each advantage holds. Read the Why column first, because the advantage often disappears when the condition does not apply. Confirm feature limits, regional availability and commitment terms with each vendor before you decide.
| Scenario | Better fit | Why |
|---|---|---|
| An Azure-first platform team | Azure Cosmos DB | Holds when identity, billing, networking and policy are already standardized on Azure. Cosmos DB is an Azure-only service with no self-hosted edition. |
| A multi-region write requirement | Azure Cosmos DB | Holds when writes must land in several Azure regions. Microsoft's documentation states a 99.999% availability SLA for multi-region writes. |
| A MongoDB-first application team | MongoDB Atlas | Holds when the application, drivers and tooling already target MongoDB. Confirm with Microsoft which MongoDB query features Cosmos DB supports for your application. |
| Development and test on free tiers | Azure Cosmos DB free tier, with the local emulator | Holds when test load stays under 1000 RU/s and 25 GB. Atlas M0 offers 512 MB and up to 100 operations per second. |
| Vector search inside the operational database | Azure Cosmos DB | Holds when vectors must sit beside operational documents on Azure. Cosmos DB includes integrated vector and hybrid search (DiskANN). |
| A steady workload that may suit reserved capacity | Azure Cosmos DB with Reserved Capacity | Holds when RU consumption is predictable over a commitment term. Microsoft's documentation says Reserved Capacity gives up to 63% off. |
| Data must stay in your own infrastructure | Self-hosted FerretDB on PostgreSQL | Holds when the app needs MongoDB 5.0+ wire protocol features FerretDB supports. Both services are vendor-operated cloud services. |
Where the capabilities overlap and where they split
Both services store documents and offer managed scaling, so the first check is which data model your application needs. Azure Cosmos DB is a fully managed NoSQL and vector database with document, vector, key-value, graph and table data models. Its change feed, continuous backup with point-in-time restore, and Azure Synapse Link or Fabric mirroring for analytics without ETL help if your analytics team needs operational data without a separate pipeline, and if you accept Azure as the only place the service runs. If your application depends on MongoDB drivers, query operators and aggregation behavior, run those exact queries against Cosmos DB before you assume the move is straightforward.
MongoDB Atlas centers on the MongoDB document model, and its restore paths differ in useful ways. Atlas cloud backup can restore from scheduled and on-demand snapshots, from continuous cloud backup, or from locally downloaded snapshot files, and restores can target a single collection or an entire database. That granularity helps if one bad write damages a single collection and you want to avoid restoring everything. Confirm the backup policy, retention settings and restore permissions for each Atlas project, and confirm whether downloaded snapshot files will sit in storage your compliance team controls. A mongodump export restores into deployments on the same major version or feature compatibility version, so test that path before you rely on it as an exit plan. For Atlas vector search and analytics options, confirm current capabilities in MongoDB's current documentation, since these features change over time.
Microsoft also offers Azure DocumentDB (vCore), a separate service built on the open-source DocumentDB engine with MongoDB wire protocol compatibility. It is a separate product from Azure Cosmos DB, so confirm which one a Microsoft document, quote or architecture diagram refers to before you compare features. If MongoDB compatibility is your main requirement, test Azure DocumentDB alongside Atlas using your own drivers and queries. Keep Cosmos DB in the comparison if you need its multi-model data, change feed or Synapse Link features. Microsoft's documentation states a 99.999% availability SLA for multi-region writes, but check the SLA terms for the exact regional and write configuration you plan to use.
How Azure Cosmos DB and MongoDB Atlas compare on capability
This table compares Azure Cosmos DB and MongoDB Atlas across nine capabilities, using published vendor documentation where it exists. Where the published information does not settle a capability, the cell names what to confirm with the vendor before assuming parity. The main takeaway is that Azure Cosmos DB is a managed Azure service with no self-hosted edition, while MongoDB offers a managed service plus a self-managed path under the SSPL, which is not OSI-approved.
| Capability | Azure Cosmos DB | MongoDB Atlas |
|---|---|---|
| Data models | Document, vector, key-value, graph and table models in one managed service | Document database. Confirm supported data models and query features with MongoDB |
| Availability | Multi-region writes carry a 99.999% availability SLA with automatic failover (Microsoft Learn) | Confirm the availability SLA, replica set and region options for your tier with MongoDB |
| Backup and restore | Continuous backup with point-in-time restore | Scheduled and on-demand snapshots, continuous backup, collection or database-level restores, and local snapshot downloads |
| Export and portability | Change feed is listed as a capability. Confirm a full export route and its format with Microsoft | mongodump binary export of documents, metadata and indexes, restorable only to the same major or feature compatibility version |
| Analytics path | Azure Synapse Link or Fabric mirroring for analytics without ETL | Not covered here. Confirm analytics integrations and their tier requirements with MongoDB |
| Vector search | Integrated vector and hybrid similarity search using DiskANN | Confirm vector search availability, index types and tier requirements with MongoDB |
| Deployment model | Azure-only managed service. Serverless accounts run in a single region and cannot add regions | Managed clusters from Flex to Dedicated. Dedicated tier runs 10 GB to 4 TB storage (MongoDB pricing page) |
| Free tier | Lifetime free tier with 1000 RU/s and 25 GB storage (Microsoft Learn) | M0 free tier with 512 MB storage and up to 100 operations per second (MongoDB pricing FAQ) |
| Self-managed edition | None. Azure DocumentDB (vCore) is a separate managed service. A local emulator exists for testing at no cost | Releases after October 16, 2018 use SSPL v1.0. Enterprise Advanced is the priced commercial self-managed option |
What drives the Azure Cosmos DB and MongoDB Atlas bill
Both bills follow the capacity you reserve or the tier you choose, plus the cost of running the platform yourself. Azure Cosmos DB charges request units per second and, in serverless mode, for consumed units, while Atlas charges by cluster tier. The cards below show what moves each bill and what to request in a written quote before comparing totals.
Provisioned request units per second
Provisioned throughput bills the RU/s you set on a database or container, even when it sits idle. Every read, write and query uses request units, so query shape, indexing and item size change how many RU/s you need. Size the workload for peak load, ask your Microsoft account team for a written estimate in your region, and compare that figure with an Atlas tier sized for the same storage and operations. Provisioned RU/s is billed even when idle.
Autoscale and serverless billing
Autoscale raises and lowers provisioned RU/s between a maximum you set and lower levels as load changes, so quiet hours cost less than a fixed peak. Serverless bills only for RUs consumed plus storage, which suits bursty or development workloads. A serverless account runs in a single Azure region and cannot add regions after creation, so check residency and availability needs before choosing it. Ask any quote to state the consumed RU and storage assumptions.
Serverless documentationFree tier and Reserved Capacity
Microsoft's documentation describes a lifetime free tier with 1000 RU/s and 25 GB of storage, enough for a pilot or small internal tool, and production needs its own sizing. Reserved Capacity gives up to 63% off Azure Cosmos DB prices in return for a term commitment, so the discount only pays off when your baseline throughput is steady. Ask for the term, the scope (region, account or subscription) and how unused reserved capacity is handled.
MongoDB Atlas tiers and limits
MongoDB's pricing page lists Atlas Free at $0 with 512 MB of storage, Flex from $0.011 per hour up to $30 a month with 5 GB, and Dedicated from $0.08 per hour, starting at $56.94 a month, with 10 GB to 4 TB of storage and 2 to 96 vCPUs. The pricing FAQ says the Atlas M0 free tier includes 32 MB of sort memory and up to 100 operations per second, which suits testing only. Compare a Dedicated size with your Azure Cosmos DB RU/s, and confirm which backup, region and support features each tier includes.
MongoDB pricing pageMongoDB Enterprise Advanced for self-management
MongoDB's pricing page describes Enterprise Advanced as the commercially licensed way to self-manage MongoDB, including Enterprise Server, Ops Manager, the Kubernetes Operator and consultative support, priced through sales. Self-managing drops the Atlas tier fee but adds your servers, storage, backups, upgrades and on-call time. Ask which unit the license is priced on, whether Ops Manager and the Kubernetes Operator are included, and what support level applies. Also confirm the license of the version you deploy, since server and tools released after October 16, 2018 fall under SSPL v1.0.
MongoDB licensing termsWhen a self-hosted MongoDB-compatible route fits better, and what it involves
When data must stay in your own data center or air-gapped network, neither product is the answer, because Azure Cosmos DB has no self-hosted edition and MongoDB Atlas is a managed service. The self-hosted route for a MongoDB-compatible application is FerretDB, an Apache-2.0 server that speaks the MongoDB 5.0 and later wire protocol and stores data in PostgreSQL with the DocumentDB extension. Azure DocumentDB is also an Azure service, so it does not meet this requirement either. Before committing, test your application against FerretDB: run your queries, indexes, aggregations and transactions, and list every Cosmos DB specific API your code calls, including change feed consumers, since some of these may have no MongoDB wire equivalent. Log each failure as migration scope before cutover.
Self-hosting moves availability design from Microsoft to your team. Microsoft's documentation states a 99.999% availability SLA for multi-region writes, backed by turnkey global distribution and automatic failover. That is a managed commitment, so a self-hosted design has to be built, tested and operated by your own staff with no vendor SLA behind it. Plan five areas: PostgreSQL and FerretDB deployment, high availability design across sites, backup and restore testing, upgrades, and monitoring with a security review of the full stack. Restore testing carries the most risk, because a backup is only proven once you restore it into a clean environment and check document counts and indexes. Confirm with your business owners the recovery time and recovery point targets, and the failover tests they will accept, before you size the cluster.
Cost has three components: staff time, infrastructure and support. Staff time recurs through on-call duty, patching, upgrades and restore drills. Infrastructure covers servers or virtual machines at each site, storage and backup targets. Hardware is usually a one-time purchase, while cloud or colocation capacity recurs. Support is optional, but a vendor or partner contract recurs, and its price depends on the response levels you require. The FerretDB license carries no fee, so compare the Cosmos DB or Atlas invoice against the sum of your staff, infrastructure and support lines. Ask any quote to split these components, to name who runs failover and restore tests, and to state what upgrade work is in scope.
Where the data lives and what leaving each product involves
Each card covers a point where data location, backup or licensing shapes a move away from Azure Cosmos DB or MongoDB Atlas. The hosting and analytics cards show what stays tied to Azure, the Atlas backup and mongodump cards show how data gets out, and the licensing and exit cards show the terms that apply once you run the software yourself.
Azure-only hosting, no self-hosted edition
Azure Cosmos DB runs only as a Microsoft Azure service, and Microsoft's documentation describes no self-hosted edition, so your data sits in the Azure regions you select. A local Azure Cosmos DB emulator is available at no cost for development and testing, but it does not replace production hosting. Confirm with Microsoft which regions and availability options your residency rules allow before you commit to a move plan.
Cosmos DB overviewAnalytics paths lead into Azure
Microsoft's documentation lists Azure Synapse Link and Fabric mirroring as ways to analyze Cosmos DB data without ETL, and the change feed as a way to stream changes to other consumers. Each path ties reporting to Azure services, so a self-hosted move must rebuild these pipelines with tools you run yourself. Ask your analytics team which of these paths they use today and which dashboards, models or exports depend on them.
Atlas backup and restore options
Atlas cloud backup restores from scheduled snapshots, on-demand snapshots, continuous cloud backup, or locally downloaded snapshot files, and it supports collection- and database-level restores. Downloaded files give you a copy outside Atlas, so test the restore path before a renewal or exit. Confirm with MongoDB which of these options your cluster tier includes and what they cost.
Atlas restore overviewmongodump restores into matching versions
mongodump writes a binary export of documents, metadata, options and index definitions from standalone deployments, replica sets, sharded clusters and Flex clusters. The output restores only into deployments on the same major version or feature compatibility version, so the target server version decides whether an export is usable. Plan a version check on both sides and run a test restore into the exact target you intend to operate.
mongodump docsSSPL for self-managed server releases
MongoDB licenses its database server and tools released after October 16, 2018, including patch fixes for earlier versions, under the Server Side Public License v1.0. That license is not OSI-approved, while releases before that date remain under GNU AGPL v3.0. Inventory which server and tool versions your self-managed fleet runs, and have counsel review the SSPL terms against your intended use before you deploy them.
MongoDB licensingExit cost and contract terms
Leaving either service can bring data egress charges, export tooling work and contract obligations. For Cosmos DB, confirm the egress rates that apply to the data you move and which export method fits the API your applications use. For Atlas, confirm the terms of your plan and any committed spend with MongoDB, and ask each vendor for its exit terms in writing.
How a move between these products or to a self-hosted route runs
This sequence moves an application's data and queries from one database to another without losing track of what changed. It produces a tested target, a documented cutover and a source that is retired only after a verified backup. Each step's effort depends on data volume and application surface, so the steps below cover order and checks only.
Inventory the data model and API calls
The application team lists every collection or container, document shape, index, driver version and query pattern the application uses, including transactions, change streams or change feed consumers, and aggregation pipelines. Each item is tagged as supported, supported with changes or unsupported on the target. The inventory is complete when the application owner signs off on it and no query pattern is left unlisted.
Map collections, containers and indexes
Each MongoDB collection or Azure Cosmos DB container is mapped to its counterpart on the target, with shard keys or partition keys, index definitions, unique constraints and TTL settings recorded side by side. For a FerretDB target on PostgreSQL, confirm each query operator and index type is supported, because wire protocol compatibility does not guarantee every server feature. The mapping is complete when every gap has a written decision: change the query, change the data design or accept the loss.
Export data from the source
For MongoDB Atlas, run mongodump with a user that has read-only access, which writes documents, metadata, options and index definitions to a binary export. For Azure Cosmos DB, confirm the export method Microsoft documents for the API your account uses, then test it on a non-production container first. The step is done when the export completes and document counts and sampled records match the source.
Restore into a supported target version
Restore the export into a target on a supported version, after checking that the target matches the source major version or feature compatibility version. mongodump output restores into deployments on that same major version or feature compatibility version, so version mismatches are resolved before any data moves. If the target is FerretDB, confirm in its documentation that a dump-based restore is supported. The step is done when collection options, index definitions and document counts match the source.
Run parallel tests with replayed queries
Run the target alongside the source using replayed, de-identified queries that match the patterns in the inventory, comparing results for each one. Measure latency, throughput and error rates under load that resembles peak use, and include failure paths such as retries, timeouts, unique key violations and large aggregations. The step closes with a written test report that marks each query pattern as passed, changed or blocked, with a named owner for every open item.
Cut over with a tested rollback plan
Agree the cutover window, the write freeze or dual-write approach and the exact signal that triggers rollback, such as error rates or result mismatches against thresholds set in the test report. Confirm that connection strings, secrets and feature flags change in one controlled release, and decide whether the source stays writable after cutover, since a live rollback path depends on keeping both sides in step. The step is done when the cutover runbook has been rehearsed and the rollback steps are signed off by the application owner.
Retire the source after a verified backup
Take a final backup of the source once writes have stopped. For Atlas, confirm the snapshot can be restored using the collection-level or database-level options Atlas documents, and restore it to a scratch environment to compare counts and sample documents. Once the check passes and the rollback window closes, remove the source, its credentials and its monitoring, then record the decommission in the change log. The step is done when the restore check is signed off and the retirement record is filed.
What buyers ask before moving off Azure Cosmos DB or MongoDB Atlas
How much does moving off Azure Cosmos DB cost?
The cost depends on the migration work, the hosting you choose and the team time on both sides, so no single figure applies to every estate. The one-time part covers discovery of data models and query patterns, the target build, the data copy, cutover and validation. The recurring part is the infrastructure you run, whether that is PostgreSQL with FerretDB in your own cloud account or on your own servers, plus patching, backups, monitoring and on-call. Costs rise with the number of containers or collections, data volume, query patterns that need rewriting, and the number of environments that must be tested for parity. Azure Cosmos DB bills in request units, so your current bill reflects throughput you provision or consume, while the target cost reflects compute and storage you size. Ask for a written scope that lists each cost component separately, names who performs each task, states what your team must supply, and marks which costs recur. Ask every provider to model the same workload profile so the comparison is fair.
How long does a database migration off Cosmos DB take?
No duration can be stated without a look at your workload, so confirm the timeline against your own data and applications in the written scope. The main drivers are the number of containers or collections, the data volume, how many applications connect, how many query patterns need validation, and how much change the cutover window allows. Migrations usually run in phases: inventory and mapping, a parallel test environment, an initial bulk copy, a catch-up sync while the source keeps taking writes, and then a cutover with a documented rollback path. Each phase needs entry and exit criteria that the scope names. Ask for the timeline as dated milestones with named owners, so you can see which steps depend on your team and which depend on approvals for production change, network access into your cloud account, or access to the source-side Azure resources.
What does a database migration need from our internal team?
Your team supplies decisions and access, while the implementation partner supplies the build and testing work agreed in the scope. Typical inputs are a named application owner for each workload, a data owner who approves what is moved and what is retained, a cloud or infrastructure owner who grants accounts and network paths, and an on-call contact for the cutover window. Security staff need to review identity, key management, encryption and audit logging for the new setup. Application teams must confirm which SDK calls, query features and consistency settings they use, because those choices determine the rework. Business users should be available to test reports and key processes against the target. Ask the written scope to name each role, the time expected from each person, and the approvals required before production work starts. Roles that stay unassigned in the scope usually surface as delays during cutover.
Can our own engineers migrate off Cosmos DB without a partner?
Yes, a team with database and application experience can run this migration in-house, and an outside partner is one option among several. The questions are whether the team has capacity alongside its normal work and whether it has run the target platform in production before. The target stack has ongoing operating tasks, including PostgreSQL maintenance, FerretDB compatibility checks, backup and restore testing, monitoring, upgrades and access control. Your engineers would own those tasks after cutover too, so the internal cost comparison should count their time at a loaded rate, the delay to planned feature work and any training. A partner can help where the team is short on time or lacks experience with a specific piece, such as compatibility testing or cutover rehearsal. DeployOpen plans, implements, hardens, backs up, upgrades and documents self-hosted platforms in your infrastructure. Ask whether the work can be split between your team and the provider, and record that split in the written scope.
Does the application need code changes to move off Cosmos DB?
It depends on which driver features and Cosmos-specific calls the application uses, and a test run is the way to find out. If the application connects through a MongoDB-compatible driver and uses common document operations, the changes may be limited to connection settings and driver versions. FerretDB speaks the MongoDB 5.0 and later wire protocol, but compatibility still has to be checked for each query operator, index type and transaction pattern you rely on. Rework is more likely where the code uses Cosmos-specific SDK calls, request unit handling, retry logic written for throttling, change feed consumers, or particular consistency settings. A driver can accept a command that the target then handles differently, so test each path. Ask the written scope to include a compatibility inventory of queries and features, a list of code paths to change, and a regression suite that runs against the target before cutover.
Does the MongoDB SSPL need legal review before we self-host?
Yes, have counsel review the terms before you self-host, because the license affects how you may run and offer the software. MongoDB states that its database server and tools released after October 16, 2018 are licensed under the Server Side Public License v1.0, which is not an OSI-approved open source license, while earlier versions are under the GNU AGPL v3.0. MongoDB's licensing page sets out the current terms. Counsel should confirm which versions you plan to run and assess how the SSPL applies to your use, including any case where you offer the database to third parties as a service. The version choice and the deployment model both matter. FerretDB is licensed under Apache 2.0 and stores data in PostgreSQL, which changes the question, but the licenses of any PostgreSQL extensions in your build also need review. Ask the written scope to list the exact versions and components so counsel has a precise list. This is not legal advice.
Does DeployOpen issue compliance certifications for the migrated database?
No, DeployOpen does not issue audit reports, attestations or certifications. It prepares systems, controls and evidence for compliance assessments, and independent auditors or certification bodies issue the reports. For a database move, that preparation can cover access control configuration, audit logging, encryption settings, backup and restore records, change records and a description of how data is handled on the new platform. Your assessor decides what evidence it accepts. Ask the written scope to list each control area, the evidence format, the owner of each artifact and the point at which the assessor reviews it. Confirm the assessor's requirements before the build starts, because evidence that is collected after cutover usually takes longer to assemble. If your environment falls under a specific framework for financial, healthcare or public sector data, name it in the scope so the evidence matches what the assessor will check.
How DeployOpen helps evaluate, implement or move these databases
DeployOpen, a Chainscore Labs company, helps teams decide whether a move from Azure Cosmos DB or MongoDB Atlas makes sense, then plans and implements the self-hosted option in the client's own cloud account, data center or air-gapped network. Work starts from a written, fixed scope, and DeployOpen can also run security testing and prepare compliance readiness evidence for the platform. Ongoing support, upgrades and continuous testing are available as retainers.
How we scope
- Written scope that names which Azure Cosmos DB or MongoDB Atlas workloads, data models and APIs are covered.
- Review of request unit throughput or Atlas tier sizing, region layout and any Azure-only features the application relies on.
- Agreed data export path, such as mongodump for Atlas sources, with a named owner for cutover and rollback.
How we build
- Where the scope fits, deploy FerretDB on PostgreSQL with the DocumentDB extension, under Apache 2.0, inside your own infrastructure.
- Integrate SSO, access control, audit logging and backups to your own storage so the platform can be reviewed by your security team.
- Test driver and query behavior against the features your application uses, because compatibility depends on the workload.
How we hand over
- Written runbooks covering deployment, backups, restores, upgrades and the monitoring used to watch the platform.
- Restore tests for each backup path, including the Atlas snapshot restores your current process depends on.
- Evidence pack for compliance reviewers: configuration records, access model, audit log samples and data handling notes.
How we support
- Ongoing support, upgrades and continuous testing are available as retainers after handover.
- Security testing of applications, APIs and infrastructure can run before go-live or on a recurring schedule.
- Ask for a quote that separates implementation, your infrastructure costs and any retainer, so recurring costs stay visible.

