If you want to keep MongoDB drivers but have AWS or Azure run the database, look at Amazon DocumentDB or the MongoDB-compatible options in Azure Cosmos DB, and check feature compatibility first. If the SSPL is the problem, FerretDB (Apache 2.0) speaks the MongoDB protocol on top of PostgreSQL. If your data is more relational than it looked, PostgreSQL with JSONB columns may be enough. For a different document platform, Couchbase adds SQL++ and mobile sync, RavenDB suits .NET teams, and Apache CouchDB is built around replication and offline-first apps. For key-based access at any scale on AWS, Amazon DynamoDB removes servers entirely. Looking for a GUI rather than a database? See MongoDB Compass alternatives.
MongoDB is a document database that stores BSON documents in collections and scales with replica sets and sharding. MongoDB 9.0 (28 September 2026) is current, and you can run it as the free Community Server, the commercial Enterprise Advanced, or the managed MongoDB Atlas service on AWS, Azure and Google Cloud.
Teams that look elsewhere usually give one of these reasons. The first three come from MongoDB's own licensing and pricing pages; the rest are our editorial reading.
- Licence. Releases after 16 October 2018 are under the Server Side Public License (SSPL), which is not OSI-approved; offering MongoDB as a service triggers its source-disclosure terms. Some organisations' policies require an OSI-approved licence.
- Enterprise pricing. Enterprise Advanced (auditing, Kerberos, the in-memory engine, Ops Manager and support) has no published price.
- Atlas costs. Dedicated Atlas clusters start from M10 and add backups, data transfer, extra nodes and regions on top; see our Atlas pricing guide.
- Cloud alignment. Teams standardised on AWS or Azure may prefer a service billed and governed by that provider (editorial).
- The data turned out to be relational. Many joins and strict schemas are easier in a relational database (editorial); see MongoDB vs PostgreSQL.
Head-to-head pages: DynamoDB vs MongoDB, MongoDB Atlas vs Azure Cosmos DB, MongoDB vs Couchbase (planned), Cassandra vs MongoDB and Redis vs MongoDB. If you are still choosing a model, start with relational vs document databases.
Quick picks
Managed, compatible with MongoDB 8.0 drivers in its 8.0 version, with instance-based, Elastic Clusters and Serverless options.
API for MongoDB on request units, and Azure DocumentDB as Microsoft's recommended target for MongoDB migrations.
Apache 2.0 proxy that speaks the MongoDB protocol and stores data in PostgreSQL.
Indexed JSON documents next to tables, joins and constraints, under the PostgreSQL licence.
Apache 2.0 document database built around multi-primary replication, with PouchDB in browsers.
No servers or versions to manage, billed per request or per capacity unit.
How we chose
We considered Amazon DocumentDB, Azure Cosmos DB (API for MongoDB) and Azure DocumentDB, FerretDB, PostgreSQL with JSONB, Couchbase, RavenDB, Apache CouchDB, Amazon DynamoDB, ArangoDB and Apache Cassandra. To be included, a product had to store JSON-style documents or speak the MongoDB protocol (DynamoDB is the exception, included as the common serverless destination for key-based workloads), be actively developed or sold in November 2026, and publish its licence or pricing model on an official page.
ArangoDB was left out as a separate entry: its Community licence limits use to internal purposes and datasets under 100 GB, so it is a multi-model choice rather than a like-for-like replacement (see its profile). Cassandra is a wide-column database for a different workload; see Cassandra alternatives. MongoDB-compatible services are described only as their providers document them: none of them is MongoDB, and each lists unsupported features.
The order is not a ranking. MongoDB-compatible options come first, then other document databases, then DynamoDB.
At a glance
| Option | Relation to MongoDB | Licence or model | Where it runs | Best for | Main trade-off |
|---|---|---|---|---|---|
| Amazon DocumentDB | MongoDB API compatible (no MongoDB code) | Managed AWS service | AWS only | MongoDB apps moving to AWS | Not every MongoDB API is supported |
| Azure Cosmos DB | API for MongoDB (RU); Azure DocumentDB separately | Managed Azure service | Azure only | Azure-centred teams | RU billing to learn; two Microsoft options |
| FerretDB | MongoDB 5.0+ wire protocol over PostgreSQL | Apache 2.0 | Self-hosted | Open source licence requirement | Compatibility is partial |
| PostgreSQL (JSONB) | Different database; JSON columns | PostgreSQL licence | Anywhere; many managed services | Mostly relational data with some flexible fields | Rewrite queries; no MongoDB API |
| Couchbase | Different document database | BSL 1.1 source; CE free with limits; EE and Capella paid | Self-managed or Capella on three clouds | SQL++ over JSON, search and mobile sync | CE capped at 5 nodes and 4 cores per node |
| RavenDB | Different document database | AGPLv3 source; free Community licence; paid by quote | Self-managed or RavenDB Cloud | .NET teams wanting built-in extras | Small free licence; no published prices |
| Apache CouchDB | Different document database | Apache 2.0 | Self-managed | Replication and offline-first apps | No multi-document transactions; no SQL |
| Amazon DynamoDB | Key-value and document service | Managed AWS service | AWS only | Known, key-based access patterns | 400 KB items; access patterns fixed up front |
Amazon DocumentDB
Amazon DocumentDB is a managed document database that implements the MongoDB API. AWS states that it does not use any MongoDB SSPL code and that it does not support every MongoDB API. DocumentDB 8.0 is compatible with MongoDB 8.0 drivers, and the 3.6, 4.0 and 5.0 API versions remain supported. Instance-based clusters scale storage from 10 GiB to 128 TiB with up to 15 read replicas; Elastic Clusters shard by hash up to 4 PiB; and Serverless scales capacity automatically, but only on version 5.0.
New users get a one-month free trial (750 hours of a t3.medium instance, 30 million I/Os, 5 GB of storage and 5 GB of backup storage). Migration from self-managed MongoDB is documented with AWS DMS. See MongoDB hosting options for how it compares with running MongoDB itself.
- Not MongoDB: check the list of supported commands and operators against your application.
- Serverless is not available with DocumentDB 8.0.
- AWS only, running inside your VPC.
Azure Cosmos DB
Azure Cosmos DB is Microsoft's globally distributed NoSQL service. Its API for MongoDB (RU) supports the MongoDB wire protocol, so existing drivers and tools work, often with a connection string change; it is billed in request units, either provisioned (standard or autoscale) or serverless, plus storage in every region. A lifetime free tier gives one account per subscription 1,000 RU/s and 25 GB.
For migrating existing MongoDB applications, Microsoft now also points to Azure DocumentDB, a separate managed service built on the open source DocumentDB engine (MIT licence). See Azure Cosmos DB explained and MongoDB Atlas vs Azure Cosmos DB.
- Request-unit costs depend on document size, indexing and query shape, so estimate with your own workload.
- Two Microsoft options for MongoDB workloads (API for MongoDB and Azure DocumentDB) need comparing before you choose.
- Azure only.
FerretDB
FerretDB is an Apache 2.0 project that accepts the MongoDB 5.0+ wire protocol and translates queries into SQL. Version 2 uses PostgreSQL with the DocumentDB extension as its storage engine. Its README describes it as a drop-in replacement for MongoDB 5.0+ "in many cases" and points to a compatibility page for known differences and supported commands.
It suits teams that already operate PostgreSQL and want document-style applications on it without the SSPL. The maintainers recommend their official binaries, images or packages over building from source, and say the evaluation Docker image keeps data inside the container, so it is not for production.
- Compatibility is partial and still improving; test your queries and indexes.
- You run and tune PostgreSQL underneath it.
- Smaller ecosystem and fewer managed offerings than MongoDB (editorial).
PostgreSQL (JSONB)
PostgreSQL stores JSON documents in jsonb columns, a decomposed binary format that can be indexed with GIN indexes and queried with containment and JSON path operators, alongside normal tables, joins, foreign keys and transactions. For many applications that chose MongoDB for schema flexibility, a few JSONB columns on otherwise relational tables cover the same need (editorial).
It is not MongoDB-compatible, so drivers and queries change, and there is no built-in automatic sharding in core PostgreSQL; extensions such as Citus add that. See MongoDB vs PostgreSQL.
- Application queries must be rewritten from the MongoDB Query API to SQL.
- Horizontal sharding needs an extension or a distributed PostgreSQL service.
- Large, deeply nested documents updated in place are not where it shines (editorial).
Couchbase
Couchbase is a distributed JSON document and key-value database queried with SQL++, a SQL dialect for JSON with joins and indexes. Services (Data, Query, Index, Search, Analytics, Eventing) can be placed on separate nodes, version 8.0 added three kinds of vector index, and App Services syncs data with Couchbase Lite on mobile and edge devices. Capella is the managed service on three clouds.
It is not an escape from source-available licensing: the source is under the Business Source License 1.1 (8.0 converts to Apache 2.0 on 1 March 2029). Community Edition is free for up to five nodes with four cores each and lacks XDCR. See Couchbase alternatives for the reverse view.
- BSL 1.1 source, not an OSI-approved licence until each version's change date.
- Community Edition limits mean most production estates need Enterprise Edition or Capella.
- We could not read Couchbase's list prices.
RavenDB
RavenDB is a JSON document database with its own query language (RQL), automatic indexes created from queries, cluster-wide transactions, sharding, time series, counters, revisions and ETL to SQL databases, Kafka and other targets. Clients exist for C#, Java, Node.js, Python, Go and others, and RavenDB Cloud runs managed clusters on three clouds.
The source is AGPLv3, and each server needs a licence key. The free Community licence allows commercial production use but is limited to 3 cores and 6 GB of RAM across up to 3 nodes; Professional, Enterprise and AI licences are yearly per core, with no published prices.
- The free Community licence is small and must be renewed yearly.
- Paid licence and Cloud prices are not published.
- RQL and its indexing model differ from the MongoDB Query API, so queries need rewriting.
Apache CouchDB
CouchDB is an Apache 2.0 JSON document database with an HTTP/JSON API. Its replication protocol lets copies on different clusters, servers, phones or browsers accept writes independently and sync later, keeping conflicting revisions for the application to resolve; PouchDB brings the same protocol to browsers and Node.js. Queries use MapReduce views, Mango indexes or Lucene-based Nouveau search. 3.5.3 (12 October 2026) is current.
It is the most permissively licensed option here, and a good fit when sync matters more than query power (editorial).
- Single-document atomic updates only; no multi-document transactions.
- No SQL or MongoDB-style aggregation pipeline.
- No managed service from the project.
Amazon DynamoDB
DynamoDB is AWS's serverless key-value and document database. Items are addressed by a partition key and optional sort key and can hold nested maps and lists; you read them with GetItem, Query, Scan or a subset of PartiQL. On-demand mode bills per request and provisioned mode per capacity unit hour, and the free tier gives 25 GB and 25 provisioned read and write capacity units per Region each month. Global tables replicate across Regions, and vector search arrived in August 2026.
It replaces MongoDB well when access patterns are known in advance and key-based, and poorly when users need ad hoc queries (editorial). See DynamoDB vs MongoDB.
- Items are limited to 400 KB and transactions to 100 actions.
- Tables and indexes must be designed around known access patterns; ad hoc queries are limited.
- AWS only.
When to stay with MongoDB
Stay with MongoDB if your concern is cost or operations rather than the database: Atlas Flex and right-sized Dedicated tiers, or self-managed Community Server, may solve it without a migration. MongoDB itself still has the widest feature set among MongoDB-compatible options, five-year support per major version, and Atlas runs on AWS, Azure and Google Cloud, which DocumentDB and Cosmos DB do not.
Switching makes most sense when the licence is a policy blocker (FerretDB, PostgreSQL, CouchDB), when one cloud provider must own the service (DocumentDB, Cosmos DB, DynamoDB), when the data model has changed (PostgreSQL, DynamoDB), or when you need features such as mobile sync or RQL that another document database builds in (Couchbase, CouchDB, RavenDB). Expect compatibility testing even for MongoDB-compatible targets.
Frequently asked questions
Is there an open source alternative to MongoDB?
Yes. FerretDB (Apache 2.0) speaks the MongoDB wire protocol over PostgreSQL, Apache CouchDB (Apache 2.0) is a document database with its own API, and PostgreSQL stores JSON in JSONB columns. MongoDB Community Server itself is free but under the SSPL, which is not OSI-approved.
Is Amazon DocumentDB the same as MongoDB?
No. AWS says DocumentDB implements the MongoDB API without using MongoDB SSPL code and does not support every MongoDB API, so test your application against it.
Can I use MongoDB drivers with Azure Cosmos DB?
Yes, with the API for MongoDB, which supports the MongoDB wire protocol. For migrating existing MongoDB applications Microsoft also points to Azure DocumentDB.
Should I replace MongoDB with PostgreSQL?
If your data has many relationships and your documents have a mostly stable shape, PostgreSQL with JSONB columns is often simpler. If you rely on MongoDB's sharding and document-centric queries, a MongoDB-compatible service is a smaller step. See MongoDB vs PostgreSQL.
What are the alternatives to MongoDB Compass?
That is a different question about GUI tools; see MongoDB Compass alternatives and MongoDB GUI tools.
Sources
- MongoDB Community Edition licensing
- MongoDB 9.0 release notes
- MongoDB pricing
- Amazon DocumentDB FAQs
- Microsoft Learn: Azure Cosmos DB for MongoDB
- Microsoft Learn: Azure Cosmos DB introduction
- FerretDB GitHub repository
- PostgreSQL documentation: JSON types
- Couchbase Server editions
- RavenDB licences
- Apache CouchDB
- Amazon DynamoDB pricing
Checked November 2026.
How we research these guides: our editorial method.