FerretDB
FerretDB is an open-source MongoDB alternative that translates MongoDB protocol queries into SQL, running on PostgreSQL with a DocumentDB extension. It allows applications to use MongoDB drivers while storing data in PostgreSQL, providing a drop-in replacement for MongoDB 5.0+ without proprietary licensing constraints.
Key facts
Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.
| Field | Value |
|---|---|
| Repository | FerretDB/FerretDB |
| Owner | FerretDB |
| Primary language | Go |
| License | Apache-2.0 — OSI-approved |
| Stars | 11k |
| Forks | 480 |
| Open issues | 446 |
| Latest release | v2.7.0 (2025-11-10) |
| Last updated | 2026-06-05 |
| Source | https://github.com/FerretDB/FerretDB |
What FerretDB is
FerretDB is a proxy written in Go that converts MongoDB 5.0+ BSON wire protocol requests to PostgreSQL SQL queries, backed by the DocumentDB extension. It maintains MongoDB driver compatibility while delegating data storage and querying to PostgreSQL, enabling existing MongoDB client applications to work without modification.
Get the FerretDB source
Clone the repository and explore it locally.
git clone https://github.com/FerretDB/FerretDB.gitcd FerretDB# follow the project's README for install & configurationNeed it deployed, integrated, or customized instead? DEV.co ships production installs.
Best use cases
Implementation considerations
- PostgreSQL with DocumentDB extension must be deployed and managed separately; FerretDB itself is stateless but requires a functioning PostgreSQL backend.
- v2.0+ is active; v1 is available on a separate branch (main-v1). Verify which version your drivers and tools support before deployment.
- Go library API is available for embedding FerretDB directly into applications as an alternative to running a standalone service.
- Docker images (ghcr.io/ferretdb/ferretdb-eval:2) provide quick evaluation but are not suitable for production; use binaries, packages, or managed cloud offerings for production workloads.
- Connection string uses standard MongoDB URI format (mongodb://user:pass@host:27017/) but connects through the FerretDB proxy, not directly to PostgreSQL.
When to avoid it — and what to weigh
- Requiring MongoDB-specific advanced features — Projects heavily dependent on MongoDB-only features (sharding topology, aggregation pipeline specifics, transactions across shards) may encounter gaps; check compatibility matrix against documented known differences.
- Need for true horizontal scaling via native sharding — FerretDB delegates to PostgreSQL, so scaling strategy depends on PostgreSQL's capabilities; if your use case requires MongoDB's native sharded cluster architecture, this is not a suitable replacement.
- Performance-critical applications with complex aggregations — Translation from MongoDB queries to SQL may introduce overhead; applications with complex aggregation pipelines or high-frequency queries should benchmark against direct PostgreSQL access.
- Strict MongoDB compliance requirements — If exact MongoDB behavior across all edge cases is mandated (e.g., specific error messages, exact numeric precision, command ordering), FerretDB's proxy layer may diverge in subtle ways.
License & commercial use
FerretDB is licensed under Apache License 2.0, a permissive OSI-approved open-source license. Apache 2.0 permits commercial use, modification, and distribution with minimal restrictions (requires license attribution and notice of changes). No copyleft obligations.
Apache 2.0 is a permissive license that explicitly permits commercial use without royalty, making FerretDB suitable for closed-source, proprietary, and SaaS applications. However, ensure your dependency on PostgreSQL + DocumentDB also meets your licensing requirements. Consult legal counsel for specific commercial scenarios involving derived works.
DEV.co evaluation signals
Editorial assessment — not user reviews. Directional, with an explicit confidence level.
| Signal | Assessment |
|---|---|
| Maintenance | Active |
| Documentation | Strong |
| License clarity | Clear |
| Deployment complexity | Moderate |
| DEV.co fit | Good |
| Assessment confidence | High |
FerretDB inherits security posture from PostgreSQL and the DocumentDB extension; review their security advisories and hardening practices. Wire protocol translation layer introduces a proxy attack surface; validate that sensitive data is encrypted in transit (TLS) and at rest (PostgreSQL configuration). No specific CVEs or security audit results are documented in the provided data. Automated security workflows are present (security.yml badge) but details are unknown.
Alternatives to consider
MongoDB with SSPL mitigation or commercial license
Use native MongoDB if licensing costs are acceptable or if your use case requires exact SSPL compliance and advanced sharding/replication features not yet fully supported in FerretDB.
CouchDB or Apache CouchDB
Fully open-source document database with native HTTP API and built-in replication; does not require a separate SQL backend but has a different query model (MapReduce, Mango) and API surface.
PostgreSQL with direct JSON/JSONB support
If you control the application code, native PostgreSQL JSON querying avoids the proxy overhead and leverages PostgreSQL's full feature set directly; less familiar MongoDB API surface but more transparent and potentially faster.
Build on FerretDB with DEV.co software developers
Start with the Docker quickstart to test FerretDB with your MongoDB driver. Review the compatibility matrix and known differences, then plan a migration or evaluation with your team.
Talk to DEV.coRelated open-source tools
Surfaced by semantic similarity across the DEV.co open-source index.
Related on DEV.co
Explore the category and the services that help you build with it.
FerretDB FAQ
Is FerretDB a drop-in replacement for MongoDB?
Do I need to change my application code to use FerretDB?
What is the performance impact of the MongoDB-to-SQL translation?
Can I use FerretDB in production?
Software development & web development with DEV.co
Adopting FerretDB is usually one piece of a larger software development effort. As a software development agency, DEV.co provides software development services and web development expertise — pairing senior software developers and web developers with your team to design, build, and operate open-source databases software in production.
Evaluate FerretDB for your project
Start with the Docker quickstart to test FerretDB with your MongoDB driver. Review the compatibility matrix and known differences, then plan a migration or evaluation with your team.