DocumentDB and FerretDB: MongoDB-compatible options on PostgreSQL
"DocumentDB" now names four different things, and only some of them run on PostgreSQL. This guide separates them, shows how FerretDB fits, and says what to test before you move an application off MongoDB.
45 minutes with an engineer: we review your workload and sketch the design.
- ✓Checked 4 Dec 2026
- ✓Vendor docs linked in every cell
- ✓OSStend runs PostgreSQL and MongoDB Community
DocumentDB is an MIT-licensed, PostgreSQL-based, MongoDB-compatible document database that Microsoft started and the Linux Foundation now hosts. FerretDB is a proxy that uses it as its engine. Azure DocumentDB is a Microsoft service built on it. Amazon DocumentDB is a separate AWS engine that emulates the MongoDB API. Checked 4 December 2026.
Customers
Partners
What is DocumentDB, and why do four products share the name?
The open-source DocumentDB project is a MongoDB-compatible document database built on PostgreSQL. It was announced as a Linux Foundation project on 25 August 2025 under the MIT licence. Two cloud services and a proxy also carry the name or build on it, so check which one a page or a quote means.
| Name | What it is | Runs on | Licence or ownership | Source |
|---|---|---|---|---|
| DocumentDB (the project) | Document database with BSON support and a gateway that translates MongoDB API calls into PostgreSQL queries | PostgreSQL extensions (pg_documentdb_core, pg_documentdb) plus a gateway | MIT; hosted by the Linux Foundation | GitHub, Linux Foundation |
| FerretDB | A proxy that converts MongoDB wire protocol queries to SQL | PostgreSQL with the DocumentDB extension | Apache-2.0 (licence link on its repository) | GitHub |
| Azure DocumentDB (with MongoDB compatibility) | Managed Microsoft service, previously named vCore-based Azure Cosmos DB for MongoDB | The open-source DocumentDB engine | Microsoft service | Microsoft Learn |
| Amazon DocumentDB (with MongoDB compatibility) | Managed AWS service that emulates the MongoDB 3.6, 4.0, 5.0 and 8.0 APIs | A purpose-built AWS engine with distributed storage | AWS service | AWS docs |
Each row is from the page in the last column, read 4 Dec 2026. Microsoft's own page says Azure DocumentDB is not Amazon DocumentDB and is not the original Azure DocumentDB service of 2014 to 2017, which became Azure Cosmos DB.
What is the Linux Foundation DocumentDB project?
It is an open-source document database that adds BSON support and document queries to PostgreSQL. The Linux Foundation announced it on 25 August 2025, calling it MIT-licensed and vendor-neutral. It began in 2024 as a pair of PostgreSQL extensions designed by Microsoft, and AWS, Google, Microsoft, Snowflake and Supabase are among its listed supporters.
- Components.
- The repository lists pg_documentdb_core (the BSON data type), pg_documentdb (the document CRUD surface) and pg_documentdb_gw (the gateway that translates MongoDB API calls to PostgreSQL queries) (GitHub, read 4 Dec 2026).
- What it adds.
- The repository lists full-text, geospatial and vector search, and says it ships as a Docker image (documentdb-local) or for on-premises installation.
- Governance.
- The Linux Foundation release says the project keeps vendor neutrality and a PostgreSQL-first commitment (press release, read 4 Dec 2026).
- What it does not claim.
- It does not say every MongoDB feature works. The release says it is compatible with popular open-source MongoDB drivers.
What is FerretDB and how does it relate to DocumentDB?
FerretDB is a proxy: it accepts the MongoDB wire protocol and converts queries to SQL, with PostgreSQL and the DocumentDB extension as the database engine. Its README calls it a drop-in replacement for MongoDB 5.0 and later "in many cases", and the DocumentDB repository lists FerretDB as a project that uses DocumentDB as its backend.
Source: the FerretDB README and the DocumentDB repository, read 4 Dec 2026. The README links a page of known differences and supported commands; we could not load FerretDB's documentation host on 4 December 2026 (a TLS error), so read that page yourself before you commit to a migration. FerretDB v1 sits on a separate branch of the repository.
The practical effect is that you have two ways to run the same engine: the application talks MongoDB wire protocol to FerretDB, or to the DocumentDB gateway, and the data lands in PostgreSQL tables either way. Operations are then PostgreSQL operations: backups, replication, failover and upgrades follow the PostgreSQL high availability guide, not MongoDB's replica set tooling.
How is it different from Amazon DocumentDB and Azure DocumentDB?
Amazon DocumentDB is not built on PostgreSQL or on MongoDB's server: AWS describes it as an emulation of the MongoDB API on a purpose-built engine. Azure DocumentDB runs the open-source DocumentDB engine and says it does not run the MongoDB server. Both are hosted services, so the lock-in is the cloud account, not the API.
| Amazon DocumentDB | Azure DocumentDB | Self-run DocumentDB or FerretDB | |
|---|---|---|---|
| API versions | MongoDB 3.6, 4.0, 5.0 and 8.0 APIs (AWS) | MongoDB wire protocol 5.0 through 8.0 (Microsoft) | FerretDB targets the MongoDB 5.0+ wire protocol (README) |
| Compatibility claim | Lists functional differences from MongoDB in its docs | Says it supports 99.03% of MongoDB's query, projection, update and aggregation operators | "Drop-in in many cases" (FerretDB README) |
| Where it runs | AWS regions only | Azure only as a service; Microsoft says the same engine runs on-premises or on any cloud with the DocumentDB Kubernetes operator | Anywhere PostgreSQL runs |
| Who operates it | AWS | Microsoft | You, or a provider such as OSStend |
| Cost shape | Instance hours, I/O requests, backup storage and data transfer (AWS) | vCores and storage; backups and database-node networking included, per Microsoft | Servers and the people who run them |
Compatibility percentages and price statements are the vendors' own claims, read 4 Dec 2026. Microsoft's "40% lower than Atlas on AWS, on average" is Microsoft's figure; it says actual savings depend on configuration and usage. Price your own workload.
Which MongoDB features are not supported?
It depends on which product, and none of the vendors claims full coverage. Amazon publishes a list of functional differences, Microsoft states a 99.03% operator figure and offers a free compatibility scan, and FerretDB links its own differences page. Run the scan or a test suite against your queries before you decide.
| Product | Documented differences (examples) | Source |
|---|---|---|
| Amazon DocumentDB | No admin or local database; one index build per collection at a time; explain() output may differ; retryable writes only from engine version 8.0.2 (disable them on earlier versions or get an error); no reverse $natural scans; $elemMatch inside $all unsupported; no guaranteed result order without an explicit sort | Functional differences |
| Azure DocumentDB | 99.03% of operators supported; a free assessment in its VS Code migration extension scans your workload and reports unsupported features | Overview |
| FerretDB | A page of known differences and supported commands is linked from the README; features are being added over time | README |
| DocumentDB (project) | We did not find a feature-by-feature list on the repository page. Test it with the documentdb-local image | GitHub |
All entries read 4 Dec 2026. The Amazon list is a selection, not the whole page.
Percentages do not tell you whether your application is in the missing 1%. Aggregation pipelines with correlated $lookup, change streams, transactions, text search and driver-specific behaviour are where we would test first. If you want a baseline for what MongoDB itself offers by edition, see MongoDB Community vs Enterprise Advanced.
Why does licence drive interest in these options?
MongoDB replaced the AGPL with its Server Side Public License for Community Server on 16 October 2018. MongoDB says the SSPL requires an organisation that offers MongoDB as a service to open-source the software it uses to provide that service. DocumentDB's MIT licence has no such condition, which is what Microsoft's page means by "no SSPL".
Sources: MongoDB press release, 16 Oct 2018 and the "Open source, with no SSPL" section of Microsoft's overview, read 4 Dec 2026. MongoDB's release says commercial customers are unaffected. For an internal deployment that you run for your own staff and applications, the SSPL's service condition is a question to put to your lawyer, not a conclusion to take from a vendor page. This is not legal advice.
When is native MongoDB or PostgreSQL JSONB the better choice?
Pick native MongoDB when your application uses features outside a compatible engine's coverage, or your support contract and tooling assume MongoDB. Pick PostgreSQL JSONB when you control the code and want SQL, joins and one engine. Pick a compatible layer when you must keep MongoDB drivers but want PostgreSQL's operations or licence.
| Situation | Best fit | Why |
|---|---|---|
| The app uses many aggregation stages, change streams or MongoDB-only tooling | MongoDB Community or Enterprise | Zero compatibility risk; see MongoDB Community vs Enterprise |
| You can change the data layer and your data is mostly relational with some documents | PostgreSQL with JSONB | One engine, SQL joins, standard PostgreSQL operations; see MongoDB vs PostgreSQL |
| You must keep MongoDB drivers and queries but want PostgreSQL storage and an MIT-licensed engine | DocumentDB or FerretDB | The wire-protocol layer is the point; test coverage first |
| You are on AWS and want a managed service with the MongoDB API | Amazon DocumentDB | Run the functional-differences list against your code |
| You are on Azure and want a first-party service on the open engine | Azure DocumentDB | Use the free assessment before moving |
The Best fit column is our reading of the vendor documentation above, not a benchmark.
How do you move off MongoDB Atlas toward one of these options?
Treat it as a compatibility test first and a migration second. Take a copy of production data, run your real queries and test suite against the candidate engine, list every difference, and only then plan the cutover with the old cluster still live. Moving to self-managed MongoDB instead follows the Atlas exit guide.
Inventory
List the operators, aggregation stages, index types, transactions and driver versions the application uses, from code and from the slow-query log.
Test on a copy
Load a snapshot into the candidate engine and run the application's own tests against it. Record each failure and its workaround.
Decide
If the gaps are small, plan the cutover. If they are large, native MongoDB on your own infrastructure is the lower-risk exit: see Atlas to self-managed MongoDB and Atlas pricing.
Cut over with a way back
Keep the old cluster current until the new side is verified. Coming from Amazon DocumentDB instead? See DocumentDB to MongoDB.
Microsoft's page lists free migration tools into Azure DocumentDB from Atlas, Amazon DocumentDB and self-hosted MongoDB. The tools move the data; they do not remove the need for the compatibility test.
Where OSStend fits, and where it does not
OSStend runs community, unforked PostgreSQL and MongoDB for customers 24/7 with named engineers. It does not run Amazon DocumentDB or Azure DocumentDB, which are the clouds' own services. If you want a second opinion on which of the three routes fits your workload, an engineer reviews it with you.
Contact us if
- ✓You want PostgreSQL or MongoDB Community run for you, in OSStend's cloud, your cloud account, your data center, Kubernetes or OpenShift, or air-gapped.
- ✓You want the design written down and signed off, and a failover rehearsed before go-live.
- ✓You are weighing an exit from Atlas and want the options compared on your real workload.
Not a fit if
- ✕You want the cloud provider to operate a service inside its own console: use Amazon DocumentDB or Azure DocumentDB.
- ✕You want MongoDB Inc. to run it: Atlas pricing lists what that costs.
- ✕You need a vendor-backed MongoDB contract: see MongoDB support without Atlas for what is and is not covered.
How OSStend runs these engines is on managed MongoDB and managed PostgreSQL. Pricing is quoted per design: pricing.
Questions about DocumentDB and FerretDB
Is DocumentDB the same as MongoDB?
No. DocumentDB, Amazon DocumentDB, Azure DocumentDB and FerretDB each implement the MongoDB API or wire protocol on a different engine. None of them runs MongoDB's server, and each documents differences from it.
Is Amazon DocumentDB built on PostgreSQL?
AWS's docs describe it as an emulation of the MongoDB API on a purpose-built database engine with distributed storage (docs, read 4 Dec 2026). They do not describe it as PostgreSQL-based.
Is FerretDB free to use?
Its repository shows an Apache-2.0 licence link. It needs PostgreSQL with the DocumentDB extension as its engine, so you still pay for the servers and the people who run PostgreSQL (README).
Is Azure DocumentDB cheaper than MongoDB Atlas?
Microsoft says Azure DocumentDB costs 40% less than Atlas on AWS on average, and that actual savings depend on configuration and usage. That is a vendor claim. Price your own cluster in both before you rely on it.
What is a good DocumentDB alternative?
That depends on which DocumentDB you mean. For Amazon DocumentDB, alternatives are MongoDB Community on your own infrastructure or a compatible engine. For the open project, they are native MongoDB or PostgreSQL JSONB. See the table in this guide.
Does a MongoDB-compatible database on PostgreSQL support transactions and change streams?
We have not verified this for DocumentDB or FerretDB, and neither repository page lists it. Test the features your application relies on, using the documentdb-local image or a FerretDB test instance, before you plan a move.
Related pages
- GuidePostgreSQL high availability: the complete guide (2026)PostgreSQL high availability explained: synchronous_commit, failover, Patroni, pg_rewind, WAL slots, pgBackRest and cloud HA, from docs read 19 Nov 2026.
- Learn · MongoDBMongoDB Community vs Enterprise: features, licenceMongoDB Community vs Enterprise Advanced: Enterprise-only features, the SSPL licence, support and pricing, from MongoDB's docs. Checked 4 Dec 2026.
- ComparisonMongoDB vs PostgreSQL for production workloadsMongoDB vs PostgreSQL for production workloads: data model, transactions, scaling and licence compared, with sources and dates, from a team that runs both.
- Migration guideMigrate MongoDB off Atlas without downtimeMigrate MongoDB off Atlas with mongosync or mongodump: version limits, what to check, how cutover works, and managed running by OSStend engineers.
- ComparisonMongoDB Atlas pricing explained (2026)MongoDB Atlas pricing from MongoDB's own page: Flex and M10 to M80 tiers, backup, transfer and uplifts, plus a self-run cost comparison. Checked 4 Dec 2026.
- Use caseAmazon DocumentDB to MongoDB: when to moveA DocumentDB alternative for an insurer: documented unsupported features, an operator and index check, a staged cutover on AWS and listed prices.
Test your MongoDB workload against the options
45 minutes: an engineer reviews which MongoDB features your application uses and tells you which route to test first, with what would be rehearsed before any cutover.
- ✓A design sketch for your workload, not a plan menu
- ✓A zero-downtime cutover path for what you run today
- ✓A price for that design, after the review





