#1★ TOP PICK
PostgreSQL
The default answer, and JSONB means you may not need a document store.
98
OPEN SOURCEPostgreSQL License (permissive)SELF-HOSTLOCAL-FIRST
Postgres is the most capable open database in general use and the one most teams should reach for first. The detail that matters on this page: JSONB gives you schemaless document storage with indexing and rich querying inside a relational database, so you can hold documents where they suit and use joins, transactions and constraints everywhere else. Add pgvector for embeddings and full-text search built in, and a large share of MongoDB deployments turn out to be Postgres deployments that took a detour. PostgreSQL Licence — permissive, foundation-governed, and not going to change.
Strengths
- +JSONB covers most document workloads without giving up relational features
- +pgvector and full-text search built in — no second database
- +Governance by a foundation; the licence will not be changed under you
- +Every cloud offers a managed version, so you are never captive to one
Trade-offs
- −Migrating from MongoDB means rewriting queries, not just moving data
- −Horizontal sharding is harder than MongoDB's
- −Genuinely document-shaped workloads at huge scale fit MongoDB better
- −Operating it yourself is still real work
Free and open source. Managed options exist from every cloud, usually cheaper than Atlas. #2
Apache CouchDB
Apache-2.0 documents, built around offline sync.
96
OPEN SOURCEApache-2.0SELF-HOSTLOCAL-FIRST
CouchDB is a document database under the Apache Software Foundation with a distinguishing feature nothing else here matches: replication designed for intermittent connectivity, so devices can work offline and reconcile later. If you are building something that must function on a phone in a field with no signal, CouchDB with PouchDB in the client solves a problem MongoDB does not attempt. Apache-2.0 with foundation governance, so the licence question is settled permanently. It is slower and less fashionable than the alternatives, and for its particular job it has no real competitor.
Strengths
- +Apache Software Foundation governance — the licence is settled
- +Best offline-first replication of any database in this comparison
- +Pairs with PouchDB for genuinely offline-capable applications
- +Simple HTTP and JSON interface with no driver required
Trade-offs
- −Slower than MongoDB or Postgres for general workloads
- −Query capability is weaker; map-reduce views take adjusting to
- −Smaller community and less momentum
- −Wrong choice unless offline sync is genuinely your problem
Free and open source. Managed hosting available from several providers. #3
FerretDB
MongoDB's wire protocol, speaking to Postgres underneath.
95
OPEN SOURCEApache-2.0SELF-HOSTLOCAL-FIRST
FerretDB implements the MongoDB wire protocol on top of Postgres, so an existing application keeps its drivers, its queries and its code while the data lives in an open relational database under a licence nobody will change. Apache-2.0, around 11k stars. It is the most surgical exit in this comparison: for the common case of a team using MongoDB as a straightforward document store, it is close to a drop-in. Compatibility is good rather than total — the exotic aggregation stages and MongoDB-specific features are where it stops.
Strengths
- +Existing MongoDB drivers and queries keep working — minimal code change
- +Apache-2.0, with data resting in Postgres
- +Sidesteps the SSPL question entirely
- +Lets you consolidate onto one database engine
Trade-offs
- −Compatibility is good but not complete — test your aggregations
- −Extra layer between application and storage
- −Younger project with a smaller community
- −Not faster than MongoDB; this is about licence and consolidation
Free and open source. You run it alongside your own Postgres. #4
MongoDB Community (self-hosted)
The same database, on your own servers, for the price of the servers.
70
SOURCE-AVAILABLESSPL (source-available, not OSI open source)SELF-HOSTLOCAL-FIRST
The most overlooked option: run MongoDB yourself. It is the identical database engine, free of charge, and for the overwhelming majority of users the SSPL restriction is irrelevant — it only bites if you offer MongoDB itself as a service to third parties. Read the licence against your own situation rather than the argument about it. What you give up is Atlas: no managed backups, no automatic failover configuration, no Atlas Search, and you own upgrades and monitoring. What you keep is every query and every driver, unchanged.
Strengths
- +Identical engine — zero application changes
- +No cluster bill; a modest server handles a lot
- +Full control over version, configuration and data location
- +SSPL restrictions do not apply to ordinary internal use
Trade-offs
- −SSPL is not OSI-approved open source, and that matters to some procurement teams
- −You own replica sets, failover, backups and upgrades
- −No Atlas Search, Vector Search or Triggers
- −Operating MongoDB well across zones is a genuine specialism
Free to download and run. You pay for servers and the people who operate them. #5
SurrealDB
Documents, graph and relational in one engine — but check the licence.
68
SOURCE-AVAILABLEBSL 1.1 (source-available, converts to Apache-2.0 over time)SELF-HOSTLOCAL-FIRST
SurrealDB is a Rust multi-model database combining document, graph and relational access through a single SQL-like language, with real-time queries and permissions built in. It is genuinely interesting engineering and around 32.8k stars. One correction that matters and that most listings get wrong: the core is licensed under the Business Source License 1.1, not an open-source licence. BSL restricts offering it as a competing service and converts to Apache-2.0 after a set period. For internal use that is usually fine; for anyone building a product on top, read it first.
Strengths
- +Document, graph and relational in a single engine — genuinely rare
- +Real-time queries and row-level permissions built in
- +Rust, fast, and can embed directly in an application
- +Converts to Apache-2.0 on a published schedule
Trade-offs
- −BSL 1.1 is NOT open source, despite how it is usually listed
- −Young relative to Postgres or MongoDB
- −Smaller ecosystem and fewer battle-tested deployments
- −Multi-model flexibility is also more ways to model something badly
Free to self-host under BSL terms. Managed cloud is paid.