FerretDB is an open source MongoDB alternative built on PostgreSQL that implements the MongoDB wire protocol, allowing applications written for MongoDB to work without code changes while storing data in Postgres.
The Problem
MongoDB changed its licensing from AGPL to SSPL in 2018, which many organizations interpret as source-available rather than truly open source. Teams running MongoDB in production face a choice: accept SSPL terms, pay for MongoDB Atlas, or migrate to a different database. Migrating an application away from MongoDB requires rewriting queries, ODM configurations, and operational tooling.
How FerretDB Solves It
FerretDB implements the MongoDB wire protocol on top of PostgreSQL. Applications that use the MongoDB driver connect to FerretDB without code changes. MongoDB BSON documents are stored as JSONB in PostgreSQL, inheriting Postgres ACID guarantees, replication, and tooling. A SQLite backend is also available for lightweight deployments. Apache-2.0 licensed.
Key Features
- MongoDB wire protocol compatibility: use existing MongoDB drivers (pymongo, Mongoose) without modification
- PostgreSQL storage backend: documents stored as JSONB with full Postgres ACID guarantees
- MongoDB query operator support: filtering, projection, aggregation, and index operations
- Compatible with MongoDB GUI tools (Compass, Studio 3T, mongosh) via the standard protocol
- SQLite backend option for lightweight single-process deployments
- Apache-2.0 licensed: true open source alternative to SSPL MongoDB
Who It's For
FerretDB is best for engineering teams running MongoDB workloads who want to move off MongoDB's SSPL license, or for new projects that want MongoDB's document model without committing to MongoDB Atlas, while keeping Postgres operational tooling for backup and replication.
Compared to MongoDB
Unlike MongoDB (SSPL licensed), FerretDB is Apache-2.0 and stores data in PostgreSQL. MongoDB is the production-proven reference implementation with the most complete feature set; FerretDB covers the core MongoDB API for most applications while providing genuine open source licensing and Postgres-based infrastructure.

