In the MongoDB vs PostgreSQL decision, our view is that PostgreSQL is the default for most products with related data and transactions, and its JSONB type covers much of the flexible-document case. MongoDB is the stronger fit when your data is genuinely document-shaped and you expect to shard writes. The choice also decides which engineers you hire.
For rates and vetting on the other stacks you might be staffing, see the series Hire developers by tech stack: rates, vetting and interview guides.
The short answer: which should a product team pick?
Pick PostgreSQL if your data has relationships you'll query across (customers, orders, invoices), if you need reporting, or if you don't have a strong reason to pick anything else. We think most products fit this description.
Pick MongoDB if each record is a self-contained document whose attributes vary from one record to the next, and you'd otherwise fight a schema to store it. Product catalogues with wildly different attributes and content objects are the usual examples.
Pick MongoDB if you already know write volume will outgrow one machine and you want sharding built into the database rather than added around it.
If licensing is a constraint, read the licensing section below before deciding. If your team already knows one of them well, that counts for more than most feature differences. Retraining on a deadline is a cost (a judgment, not a sourced figure).
Where each stands in October 2026
As of October 2026, MongoDB 9.0 is the newest major release. The 9.0 release notes date it to 28 September 2026. Among other changes they list a per-operation memory limit, a new constraint document validation level, a time series storage overhaul and server-side JavaScript re-enabled on a WASM engine.
On support dates, MongoDB's lifecycle page (the Enterprise Advanced table) gives 9.0 an end of life of 31 October 2031. MongoDB 8.0, from October 2024, runs to 31 October 2029, and so does the 8.3 minor release from May 2026. 8.2 reached end of life on 31 July 2026, and 7.0 ends on 31 August 2027. The versioning page says majors arrive about every two years with a five-year lifecycle, and that since 8.2 minor releases are also available on-prem for specific use cases such as Search, Vector Search and enhanced Queryable Encryption.
PostgreSQL 18 is current. The PostgreSQL versioning policy lists 18.6 as the current minor release, with 18 first released on 25 September 2025 and supported until 14 November 2030. Every major gets five years. PostgreSQL 14 receives its final fixes on 12 November 2026, and 13 has been unsupported since 13 November 2025. PostgreSQL 19 is in beta 4, released on 24 September 2026, with no GA date yet. The full end-of-support table for every supported version is in our guide to screening SQL developers on PostgreSQL.
Several comparisons still ranking for this query carry no release dates, and at least one misdates both MongoDB 8.0 and PostgreSQL 17 by a year. Check the date on any comparison before trusting its version claims, including this one.
Documents vs tables: how different is the data model?
MongoDB stores BSON documents. Related data usually gets embedded inside the parent document, so one read returns an order with its line items. PostgreSQL normalizes the same data into tables and joins them at query time.
As a rule of thumb, embedding is faster to read and awkward to update when the same data appears in many places. Tables are the reverse. Neither is a flaw. They're different bets about how you'll read and change the data.
The line has blurred from both sides. PostgreSQL's JSON documentation describes jsonb as a decomposed binary format with slower input and faster processing, and says it supports GIN, btree and hash indexes. It also says most applications should prefer jsonb over json. So a Postgres table can hold a flexible document column next to ordinary relational columns.
From the other direction, the new constraint validation level in 9.0 means schema enforcement is no longer only a Postgres trait. A schemaless database with enforced constraints is a different proposition from the one many older comparisons describe.
If you're also weighing vector search for retrieval, the Postgres route is covered in building retrieval on Postgres with pgvector. That's a separate decision from this one.
Transactions and consistency: is MongoDB ACID now?
Yes, with a catch. MongoDB's transactions documentation says multi-document transactions work on replica sets from feature compatibility version 4.0 and on sharded clusters from 4.2. The same page states that a distributed transaction incurs a greater performance cost than single-document writes, and that transactions are not a replacement for effective schema design.
That's the part most "ACID since 4.0" summaries skip. In MongoDB, the intended pattern is to model data so most operations touch a single document. Transactions are for the cases where you can't.
The 9.0 release notes add a cap for external clients, set through maxConcurrentMultiDocumentTransactions with a default of 10,000. At the limit, new transactions get a TooManyOpenTransactions error, so transaction-heavy workloads should check that setting.
In PostgreSQL, transactions are the base model. If your product moves money, inventory or anything else where partial writes are a bug, that's the more natural home.
Scaling: when does sharding matter?
MongoDB's sharding documentation describes a cluster of shards (each a replica set), mongos query routers and config servers. Resharding has been available since 5.0, and the config shard since 8.0. The same page says the shard key you choose affects performance, which is the design decision that's hardest to undo.
This article makes no claims about horizontal scaling options for PostgreSQL, because none of the sources used here covers them. What can be said about a single PostgreSQL node comes from the PostgreSQL 18 announcement: its new asynchronous I/O delivers up to 3x performance improvements when reading from storage, in sequential scans, bitmap heap scans and vacuum. The release also adds uuidv7(), virtual generated columns by default and OAuth 2.0 authentication.
The practical rule, and it's a judgment rather than a sourced figure: if one well-sized server plus read replicas will carry you for years, sharding isn't a deciding factor. If you can already name the write volume that won't fit, it is.
Licensing: is MongoDB open source?
Not by the Open Source Initiative's definition. According to MongoDB's SSPL FAQ, Community Server releases on or after 16 October 2018 are under the Server Side Public License, earlier ones under AGPL, and the SSPL is not OSI-approved. Several comparison pages still describe MongoDB as plainly open source.
For a product team building an app on MongoDB, the FAQ is reassuring. It says there's no copyleft obligation for an application that uses MongoDB as its database, and that providing MongoDB as a service internally or to subsidiary companies isn't treated as making it available to a third party. The section 13 obligations apply when you offer MongoDB itself as a service. In that case the FAQ says the SSPL requires releasing the source of the surrounding service software, such as management, monitoring, backup and hosting tools. This is the FAQ's reading, not legal advice, so have counsel check it if your business sits near that line.
PostgreSQL uses the PostgreSQL License, a liberal open-source licence similar to the BSD or MIT licenses.
Comparison table
| Criterion | MongoDB | PostgreSQL |
|---|---|---|
| Data model | BSON documents, embedding | Tables, joins |
| Query language | MongoDB Query API (CRUD and aggregation pipelines) | SQL |
| Current major (Oct 2026) | 9.0, end of life 31 Oct 2031 | 18, supported to 14 Nov 2030 |
| Older versions | 8.0 to 31 Oct 2029; 7.0 to 31 Aug 2027 | 14 gets final fixes 12 Nov 2026 |
| Transactions | Multi-document, at a performance cost | Base model |
| JSON support | Native documents | jsonb, GIN-indexable |
| Schema validation | Document validation, constraint level in 9.0 | Table schemas |
| Licence | SSPL (Community Server) | PostgreSQL License |
| Extensive work in past year, professional devs (Stack Overflow 2025) | 24.3% | 58.2% |
The last row comes from Stack Overflow's 2025 developer survey. MongoDB's lifecycle dates are from the Enterprise Advanced table.
What the choice means for hiring
Among 21,126 professional developers in the Stack Overflow 2025 survey, 58.2% reported extensive development work in PostgreSQL over the past year and 24.3% in MongoDB, with MySQL at 39.6%. Among all 26,083 respondents it was 55.6% and 24%. PostgreSQL's lead works out at about 2.4 to 1, a ratio derived from the two professional figures.
Read that carefully. It measures what self-selected survey takers say they worked on extensively, not how many are available to hire, at what seniority, or in your country. Recent work isn't the same as expertise, and the figures cited here have no seniority or location split. The direction is safe to conclude: more working developers report heavy PostgreSQL work than MongoDB work. A precise time-to-hire gap needs a source, and none is available here.
In our view, SQL skills transfer across relational engines, so a strong SQL engineer can pick up PostgreSQL quickly. MongoDB schema design is a distinct skill. Embedding versus referencing and shard-key choice are the decisions that go wrong, and they don't show up in a SQL interview.
For a PostgreSQL hire, screen for:
- Reading query plans and knowing when an index helps
- Choosing between
jsonband a normal column, and indexing the result - Transaction boundaries and what happens under concurrent writes
For a MongoDB hire, screen for:
- Deciding when to embed and when to reference, with a reason
- Shard-key reasoning, including what a bad key costs later
- A clear view of when a multi-document transaction is the wrong answer
The SQL guide above covers the PostgreSQL screening in more depth. MongoDB is common in JavaScript backends, so what to look for in a Node.js backend hire is the companion read on that side.
Switching later: what does migration involve?
There's no sourced figure for what a migration costs in hours or money, and anyone quoting one hasn't seen your system. The shape of the work is knowable.
Moving between the two means redesigning the data model, because documents and tables aren't a mechanical translation. Every query gets rewritten. Transaction logic changes, since one database leans on single-document writes and the other on transactions everywhere. Then everything needs testing against real data volumes.
That's why the first choice matters more than the feature checklist. Pick the model that matches how you read and write your data now, and revisit it only when hiring or scale gives you a hard reason.
FAQ
Is MongoDB open source?
Not by the OSI's definition. Community Server releases from 16 October 2018 are under the SSPL, which MongoDB's own FAQ says isn't OSI-approved. Apps that use MongoDB as their database carry no copyleft obligation under it, per that FAQ.
Does MongoDB support ACID transactions?
Yes. Multi-document transactions arrived on replica sets with feature compatibility version 4.0 and on sharded clusters with 4.2. MongoDB's documentation says they cost more than single-document writes and don't replace good schema design.
Can PostgreSQL replace MongoDB with JSONB?
For many products, yes. jsonb is a binary format with GIN indexing, and PostgreSQL's documentation recommends it over json for most applications. This article doesn't compare PostgreSQL's horizontal scaling options, so check those separately if scale is the concern.
Is PostgreSQL 14 still supported?
Until 12 November 2026, when it gets its final fixes. After that date, a PostgreSQL 14 database should be upgraded. PostgreSQL 18 is the current major release.
Which is easier to hire for?
PostgreSQL, on the survey numbers: 58.2% of professional respondents in Stack Overflow's 2025 survey reported extensive development work in it over the past year, against 24.3% for MongoDB. That's recent work, not availability in your market, and the figures cited here have no seniority or location split.
Is MongoDB 9.0 production ready?
It was released on 28 September 2026, with a lifecycle running to 31 October 2031. Beyond that, the sources used here say nothing about production readiness, so check the 9.0 release notes against your workload before upgrading.
