Amazon DocumentDB vs Azure Cosmos DB: which fits your workload
Amazon DocumentDB fits teams that run on AWS and want a MongoDB-compatible document database. Azure Cosmos DB fits teams on Microsoft Azure that need a multi-model NoSQL service with global distribution. Both are managed-only services inside their own clouds. AWS describes DocumentDB as fully managed and MongoDB API-compatible, and its instances run only inside Amazon VPC. Cosmos DB is an Azure-only service with no self-hosted edition, although Microsoft provides a local emulator for development and testing. The decision therefore turns on four factors: your cloud estate, the API and data model your applications use, your regional and compliance needs, and how much lock-in you can accept.
Start with the API, because it determines how much work a move involves. If your applications use MongoDB drivers and queries, MongoDB API compatibility makes DocumentDB the closer match, since AWS says applications can typically migrate without code changes. Cosmos DB covers document, vector, key-value, graph and table data models, so an application built on any of those models needs a code review before it moves anywhere else. Ask your engineering team to list every driver version, query operator, index type and transaction pattern in use, then run them against a test instance of each candidate. If you are on Azure and want MongoDB wire protocol compatibility, also evaluate Azure DocumentDB (vCore), a separate service built on the open-source DocumentDB engine.
Regional and compliance needs narrow the field quickly. DocumentDB holds FedRAMP High authorization for AWS GovCloud (US) Regions and FedRAMP Moderate for the AWS US East and West Regions, and Global Clusters replicate data across up to 10 AWS Regions. Cosmos DB multi-region writes carry a 99.999% availability SLA, but a serverless account runs in a single Azure region and cannot add regions after creation, so confirm the capacity mode before you design around global failover. Check which authorizations and regions apply to your own workload with each provider in writing. On lock-in, both services are managed only, so document the export path for each candidate, keep data access code in one layer, and scope a self-hosted MongoDB-compatible option such as FerretDB on PostgreSQL in the same review.
Which scenario points to Amazon DocumentDB or Azure Cosmos DB
This table matches common buyer scenarios to the better fit between Amazon DocumentDB and Azure Cosmos DB. Read each row as a condition check: if the stated condition holds for your workload, that option is the stronger starting point. The main takeaway is that cloud location, region strategy and compliance boundary usually decide the choice before feature details do.
| Buyer scenario | Better fit | Condition that makes it so |
|---|---|---|
| Illustrative: AWS-hosted MongoDB app moving off MongoDB Atlas or self-managed MongoDB | Amazon DocumentDB | Already on AWS and wants MongoDB API compatibility with the fewest application changes. Confirm your driver and feature usage against your target engine version. |
| Illustrative: Azure-native app that needs writes in several regions | Azure Cosmos DB | Microsoft documents a 99.999% availability SLA for multi-region writes. Serverless accounts stay in one region, so choose provisioned or autoscale throughput. |
| Illustrative: team that needs vector search next to operational documents | Azure Cosmos DB | Choose it when vector search must sit in the same Azure service. Confirm DocumentDB vector support for your engine version before deciding. |
| Illustrative: team with US federal workloads | Amazon DocumentDB (documented FedRAMP authorizations) | FedRAMP High covers AWS GovCloud (US) Regions; Moderate covers AWS US East and West. Confirm your required impact level and services in scope with AWS. |
| Illustrative: analytics team that wants no-ETL access to operational data | Azure Cosmos DB | Microsoft lists Azure Synapse Link and Fabric mirroring for analytics without ETL. This suits an Azure analytics stack; confirm DocumentDB's analytics integrations with AWS. |
| Illustrative: small team with variable traffic and a limited development budget | Azure Cosmos DB (serverless) | Serverless bills only for consumed RUs and storage. Serverless runs in one region, so check recovery needs before production use. |
| Illustrative: team that must run the database on its own servers or in another cloud | Neither managed service | Both are cloud-only managed services. Consider a self-hosted MongoDB-compatible option such as FerretDB on PostgreSQL, and confirm its fit. |
How to decide between the two managed services
The decision starts with where the data must live. If a self-managed deployment is required, the path ends at FerretDB on PostgreSQL, which speaks the MongoDB 5.0+ wire protocol. If a managed cloud is acceptable, the next check is the provider. AWS leads to Amazon DocumentDB, which is MongoDB API compatible. On Azure, the path first asks whether MongoDB wire protocol compatibility is needed, which points to Azure DocumentDB (vCore), a separate service. Otherwise, Azure Cosmos DB is the choice, with multi-region writes or single-region serverless as the deciding factor. Confirm the regions, the API your application calls and the cost model before you choose.
Decision path from required hosting to the matching managed or self-hosted option.
How Amazon DocumentDB and Azure Cosmos DB compare on capabilities
This table compares the capabilities that most often shape a move between Amazon DocumentDB and Azure Cosmos DB, from API fit and scale to compliance and analytics. Where a cell says to confirm, the answer depends on your account, region and engine version, so check it with AWS or Microsoft before you rely on it. The main takeaway is that both services run only in their vendor's cloud, so the decision turns on API fit, regional and compliance needs, and analytics paths.
| Capability | Amazon DocumentDB | Azure Cosmos DB |
|---|---|---|
| Service model and deployment | Managed service with instance-based and elastic clusters, running only inside Amazon VPC | Fully managed Azure service only, with no self-hosted edition; a local emulator covers development and testing |
| API and data models | MongoDB API compatible, so applications can typically migrate without code changes | Document, vector, key-value, graph and table models; confirm which API surfaces your application needs |
| Scale and sizing | Elastic clusters support millions of reads and writes per second and petabytes; instance storage grows to 256 TiB on engine 8.0 and later | Throughput sized in request units (RU/s) with provisioned, autoscale or serverless modes |
| Replicas and regions | Up to 15 replica instances per instance-based cluster; Global Clusters span up to 10 AWS Regions | Multi-region writes and turnkey global distribution; serverless accounts stay in one region and cannot add regions later |
| Availability commitments | Confirm the availability commitment for your cluster type and Region with AWS | Microsoft documents a 99.999% availability SLA for multi-region writes, with automatic failover |
| Backup, recovery and encryption keys | Automatic backups kept up to 35 days with point-in-time recovery; encryption at rest with AWS KMS keys | Continuous backup with point-in-time restore; confirm retention windows and key options with Microsoft |
| Compliance authorizations | FedRAMP High for AWS GovCloud (US) Regions and FedRAMP Moderate for AWS US East and West Regions | Confirm current authorizations for your Azure region and government cloud with Microsoft |
| Vector search | Confirm vector search support and index types for your engine version with AWS | Integrated vector and hybrid similarity search using DiskANN |
| Change feed and analytics integration | Confirm change stream and analytics export options for your cluster type with AWS | Change feed, plus Azure Synapse Link or Fabric mirroring for analytics without ETL |
Amazon DocumentDB vs Azure Cosmos DB pricing structure, not price levels
Both services bill by component, so two quotes can look similar and still diverge. The cards below map how each product builds a bill, from instances and request units to trials and commitment discounts, and what to ask for in writing before comparing totals.
DocumentDB standard and I/O-Optimized
Amazon DocumentDB bills instances, I/O, storage and backup storage under its standard configuration. The I/O-Optimized configuration bills instances, storage and backup storage, so the separate I/O charge no longer appears on the bill, and the cost comparison depends on how many I/O operations your workload generates. Ask AWS for a written quote that models both configurations against your current usage profile.
DocumentDB product pageDocumentDB serverless option
Amazon DocumentDB also offers a serverless option, which uses a different billing path from the instance-based and elastic clusters described in the service documentation. Confirm in writing which meters apply to your workload, how capacity scales with demand, and whether storage and backup charges still apply on top. Also check whether your connection pattern and idle periods suit serverless before you base a budget on it.
Cosmos DB request units
Azure Cosmos DB bills in request units, so every read, write and query draws from a throughput budget measured in RUs. Provisioned throughput bills the RU/s you reserve, autoscale adjusts throughput to demand, and serverless bills only the RUs consumed plus storage. Ask the vendor for the expected RU consumption per operation and for peak and steady demand in writing, because the right mode depends on whether your demand is steady or spiky.
Cosmos DB serverless docsFree tier and trial
Azure Cosmos DB includes a lifetime free tier of 1000 RU/s and 25 GB of storage, which can cover a development or small test workload at no charge. Amazon DocumentDB offers a 1-month free trial, which is time-limited and should be planned around your evaluation window. Confirm how the Cosmos DB free tier applies across your accounts and subscriptions, and what the DocumentDB trial includes before you start a proof of concept.
Reserved capacity discount
Azure Reserved Capacity gives up to 63% off Azure Cosmos DB prices in return for a commitment, so the saving depends on how predictable your RU consumption is. Ask how the reservation is scoped, including which regions, accounts and term lengths it covers, and what happens to reserved capacity you do not use. Ask AWS separately whether DocumentDB offers a comparable commitment discount, because the discount above applies to Cosmos DB only.
What drives the bill
On DocumentDB, the main drivers are instance count and size, up to 15 replica instances, I/O volume, storage growth and backup retention of up to 35 days. On Cosmos DB, the drivers are RU/s or RUs consumed, the number of regions and storage, and a serverless account runs in one region and cannot add regions after creation. Global Clusters replicate across up to 10 AWS Regions, so model each region, replica and retention setting before comparing totals.
What running each service costs in effort and skills
Managed services still leave work with you. On both services, the customer owns capacity planning, query and index design, regional layout and monitoring, and these tasks carry most of the recurring effort. The planning unit differs. With Amazon DocumentDB, you choose instance sizes, decide how many of up to 15 replica instances to run in an instance-based cluster, and track storage that grows in 10 GB increments up to 256 TiB on engine version 8.0 and later. With Azure Cosmos DB, you plan request units per second (RU/s) for each database or container, choose between manual provisioned throughput, autoscale and serverless, and track how many RUs each operation consumes.
Query patterns and indexing set the throughput bill on both services, so they belong in the same review as sizing. In Azure Cosmos DB, each query and write consumes RUs, and the container's indexing policy, set through the indexingPolicy property, decides which paths are indexed and how much work each write does. An unindexed filter can turn a cheap read into an expensive scan that competes with other workloads for the same RU/s. On DocumentDB, the same mistake appears as higher instance CPU and I/O, which pushes you toward larger instances or more replicas. Regional design is decided early. Global Clusters replicate data automatically across up to 10 AWS Regions, while a Cosmos DB serverless account runs in a single Azure region and cannot add regions after creation. Each extra region adds replication traffic and capacity to size, so confirm the region list before the first production load.
Monitoring and alerting turn these decisions into recurring work. Setup is a one-time job: define a sizing baseline, set alert thresholds for throttling, CPU and storage growth, and test restores from automated backups, which DocumentDB keeps for up to 35 days. After that, the work recurs: review RU consumption per query, watch for throttled (HTTP 429) responses in Cosmos DB, re-check replica counts as read traffic changes, and re-tune indexes whenever a new query pattern ships. Costs rise with data volume, write rates, the number of regions and the number of replicas or RUs held in reserve, and fall when indexes are trimmed and idle capacity is removed. Ask each vendor how it exposes cost and throughput metrics: confirm which DocumentDB instance, I/O and storage metrics are available in Amazon CloudWatch, and how Azure Monitor reports RU consumption and throttling for your account, and whether they match billed units.
How data location, export and lock-in shape an exit from each service
Amazon DocumentDB and Azure Cosmos DB are managed services from different clouds, so an exit depends on where data can run, how it is encrypted and backed up, and which APIs your code calls. The cards below cover each factor and the checks to run before you commit to either service.
Where the service can run
Amazon DocumentDB instances run only inside Amazon VPC, so the workload stays in AWS Regions, and Global Clusters extend replication to up to 10 AWS Regions. Azure Cosmos DB is an Azure-only service with no self-hosted edition, and its local emulator is meant for development and testing. Neither service can run in your own data center or air-gapped network. Confirm which regions and residency commitments each vendor provides for your account before you design the exit.
Cosmos DB overviewEncryption key ownership
Amazon DocumentDB encrypts data at rest with keys managed through AWS KMS, and the key lifecycle depends on whether you use the AWS managed key or a customer managed key. Review who can disable or schedule deletion of that key, because the decision reaches the whole cluster and its backups. Confirm with Microsoft which customer-managed key options apply to your Azure Cosmos DB account type and where those keys are held. Record both answers in the exit plan, since the key is a dependency the migration must work around.
DocumentDB developer guideBackup retention and restore
Amazon DocumentDB takes automatic backups with a retention period of up to 35 days and supports point-in-time recovery. Azure Cosmos DB provides continuous backup with point-in-time restore, so confirm its retention window, restore process and charges for your account. A restore brings data back into the same service, so backups alone do not create an exit path. Ask each vendor whether backups can be exported in a format your target engine can read.
API and data model lock-in
Amazon DocumentDB is MongoDB API-compatible, so applications can typically move without code changes, but test every MongoDB feature your code uses against the service. Azure Cosmos DB exposes its own SDKs and data model features, including change feed, Azure Synapse Link or Fabric mirroring for analytics, and integrated vector search. Each one your pipelines consume becomes a rewrite item during an exit. Map those dependencies before choosing a target, and consider a MongoDB wire protocol option if that compatibility is the requirement you need to keep.
FerretDB repositoryServerless and region limits
A serverless Azure Cosmos DB account runs in a single Azure region and cannot add regions after creation. A later need for a second region would mean creating a new account and migrating data into it. Amazon DocumentDB Global Clusters replicate data across up to 10 AWS Regions, so compare the topology each service can reach. Confirm with each vendor how region changes are handled on your tier before you commit to one.
Cosmos DB serverlessWhat leaving involves
An exit needs three things: an export path, a target that runs in your infrastructure, and a cutover plan. Ask AWS and Microsoft to confirm export tooling, data formats and egress costs for your data volume, in writing, before you size the project. Azure Cosmos DB has no self-hosted target, so its exit goes to a different engine, such as a MongoDB-compatible engine you operate. Amazon DocumentDB exits depend on how far your application uses features beyond MongoDB compatibility.
When a self-hosted route fits better than either service
The deciding question is where the data must physically live, and which API the application speaks comes second. Neither Amazon DocumentDB nor Azure Cosmos DB can run in your own data center or air-gapped network. AWS documents that DocumentDB instances run only inside Amazon VPC, and Microsoft describes Azure Cosmos DB as an Azure service with no self-hosted edition. The local Azure Cosmos DB emulator is offered for development and testing, so it does not answer a production residency question. If regulators or internal policy require that database storage, backups and encryption keys stay under your own control on your own hardware, write that requirement down first and check each vendor's residency terms with your compliance team before comparing features.
If the need is a MongoDB-compatible API without an AWS or Azure commitment, FerretDB is the open-source option to evaluate. It is licensed under Apache-2.0, speaks the MongoDB 5.0+ wire protocol, and stores data in PostgreSQL with the DocumentDB extension, so existing PostgreSQL operations practice for backup, replication and upgrades applies. Review the FerretDB project and confirm the MongoDB driver versions, commands and index behaviors your applications use against the release you plan to run, because wire protocol compatibility does not guarantee every behavior. Ask whether your database team can own patching, replication and restore tests, since those duties move to your organization once the service runs in your environment.
Cloud exit risk changes the decision in a different way. Leaving Azure Cosmos DB requires more than a connection string change. Features such as the change feed and the request unit (RU) model in the SDK shape how applications read events and throttle work, so each dependency needs a redesign plan before any data moves. Inventory every use of change feed, RU-based throughput settings and retry logic, and confirm application compatibility in a staging copy. If you plan to run self-managed MongoDB instead, note that MongoDB server releases after October 16, 2018 fall under the Server Side Public License (SSPL) v1.0, so check that license against your hosting and redistribution needs with legal counsel before standardizing on it.
What a move between the two products involves
The sequence moves a document workload off one managed service and onto a target that the team can verify, with data, indexes and application behavior checked at each stage before traffic moves. The output is a documented, tested cutover with a rollback path and the evidence that security and compliance teams need to review the new environment.
Inventory APIs, drivers and query patterns
Application owners list every service, job and script that connects to the cluster, along with the driver and version each one uses. Engineers capture the query, aggregation, update, index hint and transaction patterns each one relies on, including scheduled reports and admin tools that teams often forget. Azure DocumentDB uses the MongoDB wire protocol, while Azure Cosmos DB is a separate service with its own documented data models, so confirm which one fits the workload before testing. The output is an inventory where every operation has an owner and a matching test case.
Map data model, indexes and regional design
Engineers document each collection's shape, index definitions, document size range, expiry settings and change-stream dependencies, then record which reads must be served from more than one region. Regional design differs by target: DocumentDB Global Clusters replicate across up to 10 AWS Regions, while a serverless Cosmos DB account runs in a single Azure region and cannot add regions after creation. The architecture lead signs a mapping from each source collection and index to its target design. The output is that mapping, approved before any data moves.
Run compatibility tests on staging
The QA and platform teams restore a recent backup into a non-production environment on the target and run every inventoried operation against it, including error handling, transaction behavior and queries that depend on specific indexes. Each failure is logged with the request, the expected result and the fix, whether that is a query rewrite, an index change or an application patch. Application owners retest after each fix. The output is a compatibility report where every in-scope operation passes or carries an approved change.
Export and load data in bulk
The database team picks an export method that suits the source, the target and the data volume, then runs an initial bulk load into the target. Load time and cost depend on data volume, index build effort and the write capacity the target allows during the load, so ask the vendor for guidance matched to your sizes. Reading from a replica or a restored snapshot limits production impact where the platform allows it. The output is a load log per collection with document counts and index build results that match the source.
Set up replication or dual writes
The architecture and application leads choose between change-based replication and dual writes. Replication keeps the target synchronized from the source's change feed or change stream while the application still writes only to the source, which keeps application changes small. Dual writes move the write path into the application, so it needs reconciliation logic for writes that succeed on one side and fail on the other. Confirm which change feed or change stream the source and target expose for the chosen tooling. The output is a running sync with measured lag, or a dual-write path with a tested failure procedure.
Validate data, behavior and performance
The database and QA teams compare document counts, sampled content checksums and query results between source and target, then replay representative production traffic against the target. They measure latency, throughput limits and error rates against the baseline the business accepted before cutover. Security reviewers confirm encryption keys, network paths and access roles on the target. The output is a reconciliation report with every difference explained and a performance result that the service owner has signed.
Run the cutover with a rollback path
The change owner schedules a window, freezes schema changes, stops writes to the source or drains the dual-write queue, and confirms replication lag is zero before switching connection strings or DNS to the target. Rollback steps are written and rehearsed before the window, including how writes accepted by the target return to the source if the team decides to revert. The output is a cutover record with start and end times, verification results and the decision point after which rollback is no longer planned.
Decommission the source and keep evidence
After the stabilization period agreed in the plan, the team stops replication, removes source credentials and network rules, and deletes or archives the source cluster under the retention policy. Backups and snapshots kept for compliance stay under the same access controls and are listed in the record. The output is a decommissioning record, plus updated architecture, access and data-flow documentation that security and compliance reviewers can check against the new environment.
Questions buyers ask before comparing Amazon DocumentDB and Azure Cosmos DB
What drives the cost of Amazon DocumentDB and Azure Cosmos DB?
The two services bill in different units, so compare them with a workload model built from your own traffic, data size and backup needs. Amazon DocumentDB bills for instances, I/O, storage and backup storage under its standard configuration, and for instances, storage and backup storage under the I/O-Optimized configuration. A serverless option and a 1-month free trial are also available. Azure Cosmos DB bills in request units (RUs): provisioned throughput charges for the RU/s you set, autoscale adjusts throughput, and serverless charges for RUs consumed plus storage. On both sides, the main drivers are instance or throughput size, read and write volume, the number of replicas or regions, and backup retention. On the Cosmos DB side, the RU cost of each query depends on the data model, indexing and partitioning, so measure it before you forecast. Ask each vendor for a quote based on a sized workload, and confirm current regional rates on their pricing pages.
Does Amazon DocumentDB or Azure Cosmos DB require a commitment?
Pay-as-you-go use is the usual starting point on both platforms, but commitment options can lower the bill and also create exit costs. Azure Cosmos DB offers Reserved Capacity, and Microsoft's documentation says it gives up to 63% off Azure Cosmos DB prices. Ask which term length applies, whether the reservation is tied to a region, and whether it can be cancelled or exchanged if you move workloads. For Amazon DocumentDB, confirm with AWS which commitment terms, if any, apply to instances and storage in your regions. Under either vendor, a commitment signed for a workload you later migrate can become a stranded cost, so model the end date against your migration timeline. Get every term in writing before you compare the two bills.
How much effort does a move from Amazon DocumentDB or Cosmos DB involve?
Effort depends mostly on how much of your application is tied to one vendor's API and how much data must move with limited downtime. AWS states that Amazon DocumentDB is MongoDB API-compatible and that applications can typically migrate without code changes, so that work usually centers on validating queries, indexes and drivers. Azure Cosmos DB is a different case: if your application uses its own SDKs, query dialect or features such as change feed, the code and data pipelines need rework. Other drivers include data volume, the copy method, acceptable cutover downtime, backup and point-in-time recovery requirements, identity integration, and any analytics pipelines such as Synapse Link or Fabric mirroring that depend on the source. Count collections, indexes, triggers, stored procedures and downstream consumers before you estimate anything.
Can our own team migrate off DocumentDB or Cosmos DB without a partner?
Yes, a team with MongoDB or PostgreSQL operations experience can often run a simple migration alone, but the risk sits in cutover, rollback and validation. A common self-hosted target is FerretDB, which speaks the MongoDB 5.0+ wire protocol and stores data in PostgreSQL with the DocumentDB extension, as described in the FerretDB repository. Your team would then own PostgreSQL, the extension, backups, monitoring, upgrades and on-call response for that stack. Teams with those skills usually start with a non-production copy, a query inventory and a rehearsed rollback before they touch production. If the team lacks one of those skills, or the workload is business critical, a fixed-scope engagement can cover the gap. DeployOpen plans, implements, hardens and documents self-hosted open-source platforms in your own infrastructure, with scope agreed in writing before work starts.
What does a database migration need from our internal team?
Your side of the project is mostly decisions, access and evidence. Plan for these inputs before the work starts:
- A named owner who can sign off on data classification, cutover timing and rollback criteria.
- Access to the source and target environments, including the cloud account or data center, network paths and secrets handling. Amazon DocumentDB instances run only inside Amazon VPC, so plan the routes from that VPC to the new platform.
- A query, index and schema inventory from the application team, with the most frequent and most expensive operations listed.
- Current backup retention, recovery targets and the compliance requirements the new platform must meet, such as SSO, access control and audit logging.
- Test data, a staging window and people available for validation during cutover.
Ask any provider to write these inputs into the scope so each item has a named owner and a date.
Is Azure DocumentDB (vCore) the same service as Azure Cosmos DB?
They are separate services. Microsoft distinguishes Azure DocumentDB (vCore), which runs the open-source DocumentDB engine with MongoDB wire protocol compatibility, from Azure Cosmos DB, a fully managed NoSQL and vector database with document, vector, key-value, graph and table data models. Azure Cosmos DB bills in RUs and offers multi-region writes with a 99.999% availability SLA, while Azure DocumentDB uses a vCore model. Azure Cosmos DB runs only as an Azure service with no self-hosted edition, so if self-hosting matters to you, the open-source DocumentDB engine is a candidate to evaluate. Confirm the product name, API and billing model with Microsoft before you compare prices or migration steps, because the two services differ in APIs, billing units and migration paths.
How DeployOpen helps evaluate, implement or integrate the chosen database
DeployOpen helps teams compare Amazon DocumentDB and Azure Cosmos DB against their workload, data residency and exit requirements. Where a self-hosted open-source platform fits, DeployOpen plans, implements, customizes, integrates, hardens, backs up and documents it inside your own cloud accounts, data centers or air-gapped networks. Each engagement is fixed-scope and agreed in writing before work starts, with a quote following from that scope.
How we scope
- Written scope lists the workloads, data models and regions that the database choice must cover.
- Scope covers the backup retention, point-in-time recovery and encryption key ownership you require.
- Engagements are fixed-scope, with deliverables and timelines agreed in writing before work starts.
How we build
- Build a proof of concept that loads sample documents and runs your production query patterns.
- Deploy the chosen self-hosted platform, FerretDB on PostgreSQL for example, inside your own accounts or data centers.
- Integrate identity, access control, audit logging and backup jobs with your existing security tooling.
How we hand over
- Hand over architecture diagrams, runbooks, configuration files and restore test results for your review.
- Document the migration steps, data mapping and rollback plan for the application teams.
- Prepare evidence such as control mappings and configuration records for your independent assessor.
How we support
- Ongoing support is available as a retainer, with scope and fees agreed in writing.
- Upgrades cover the database engine, its extensions, and the backup and restore procedures you depend on.
- Continuous security testing can run alongside the retainer to recheck the database configuration over time.

