DEV.co
Open-Source Databases · FerretDB

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.

Source: GitHub — github.com/FerretDB/FerretDB
11k
GitHub stars
480
Forks
Go
Primary language
Apache-2.0
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
RepositoryFerretDB/FerretDB
OwnerFerretDB
Primary languageGo
LicenseApache-2.0 — OSI-approved
Stars11k
Forks480
Open issues446
Latest releasev2.7.0 (2025-11-10)
Last updated2026-06-05
Sourcehttps://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.

Quickstart

Get the FerretDB source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/FerretDB/FerretDB.gitcd FerretDB# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

Migration from MongoDB to open-source infrastructure

Organizations using MongoDB under SSPL licensing can migrate to FerretDB with minimal application changes, keeping existing MongoDB drivers and tooling while switching to PostgreSQL's open-source foundation.

Open-source projects requiring document databases

Projects that need document-oriented data models but cannot adopt SSPL-licensed MongoDB can use FerretDB as a fully open-source (Apache 2.0) alternative without licensing restrictions.

Rapid prototyping with document-oriented APIs

Early-stage startups and development teams can leverage MongoDB's familiar API surface and driver ecosystem while maintaining full control via open-source PostgreSQL infrastructure.

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.

SignalAssessment
MaintenanceActive
DocumentationStrong
License clarityClear
Deployment complexityModerate
DEV.co fitGood
Assessment confidenceHigh
Security considerations

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.

Software development agency

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.co

Related 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?
Mostly yes for MongoDB 5.0+ and common use cases, but check the documented known differences and compatibility matrix. Complex aggregation pipelines, sharding behavior, and some edge-case commands may diverge.
Do I need to change my application code to use FerretDB?
No. Any existing MongoDB driver and application code should work unchanged; FerretDB exposes the MongoDB wire protocol. Only the connection string needs to point to FerretDB instead of MongoDB.
What is the performance impact of the MongoDB-to-SQL translation?
Unknown without benchmarking against your workload. FerretDB introduces a translation layer; simple queries may have minimal overhead, but complex aggregations may be slower than native MongoDB. Benchmark before production migration.
Can I use FerretDB in production?
Yes, if you use official binaries, packages, or managed cloud offerings (Civo, Tembo, Elestio, Cozystack). Do not use the evaluation Docker image (ghcr.io/ferretdb/ferretdb-eval:2) in production; it loses data on shutdown.

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.