FerretDB bridges the gap between MongoDB’s document-oriented development experience and the robustness, transparency, and licensing freedom of PostgreSQL. Designed for developers and organizations seeking open infrastructure without compromise.

MongoDB revolutionized application development with its flexible schema and intuitive document model. However, since MongoDB Inc. adopted the Server Side Public License (SSPL), many open source advocates, startups, and enterprise architects have been forced to rethink their database strategies. FerretDB emerges as a compelling solution—an open source proxy that translates MongoDB wire protocol queries into PostgreSQL SQL, using the DocumentDB extension to preserve the document-store experience while ensuring backend resilience.

What is FerretDB?

FerretDB is not a database engine itself. It acts as a transparent proxy that lets you use MongoDB drivers and tooling while storing and querying data on PostgreSQL. Applications interact with FerretDB as if it were a MongoDB server, but behind the scenes, all operations are translated to SQL.

This approach allows users to benefit from:

  • PostgreSQL’s transactional integrity and tooling,
  • Continued use of familiar MongoDB APIs,
  • Freedom from license restrictions,
  • Open infrastructure without vendor lock-in.

Architecture Overview

FerretDB is designed to be drop-in compatible with MongoDB 5.0+ in many scenarios. Here’s how the architecture works:

flowchart LR
  A["Application<br>MongoDB driver"]
  F{{FerretDB<br>proxy layer}}
  P[(PostgreSQL<br>+ DocumentDB extension)]

  A -- "MongoDB protocol (BSON)" --> F
  F -- "SQL (PostgreSQL protocol)" --> P

This architecture enables MongoDB clients like mongosh, Compass, and libraries like Mongoose or PyMongo to function with FerretDB without changes in the codebase.

Why Use FerretDB?

FerretDB exists to solve a practical problem: MongoDB’s SSPL license is considered non-compliant with open source definitions (e.g., by the OSI or Debian). Many organizations now prefer a database that is truly open, especially in regulated sectors or privacy-focused environments.

Here are the core benefits of FerretDB:

1. Fully Open Source (Apache 2.0)

Unlike SSPL, the Apache 2.0 license is business-friendly, OSI-approved, and widely adopted across the industry. You are free to use, modify, and distribute FerretDB without the legal overhead.

2. Seamless MongoDB Compatibility

FerretDB supports most common MongoDB operations including:

  • insert, find, update, delete
  • Aggregations
  • Indexing
  • Geospatial queries (in progress)
  • Replica set emulation (via PostgreSQL features)

3. PostgreSQL Reliability

Data is stored in a PostgreSQL database using the JSONB column type. This ensures:

  • ACID compliance
  • SQL-based analytics
  • Mature backup, replication, and monitoring tools

4. Sustainable Infrastructure

PostgreSQL is a trusted, community-driven RDBMS with wide support across cloud providers and Kubernetes environments. FerretDB enables a hybrid NoSQL-on-SQL approach that fits into existing PostgreSQL stacks.

Feature Comparison: FerretDB vs MongoDB

FeatureMongoDB Community EditionFerretDB + PostgreSQL
LicenseSSPL (not OSI-approved)Apache 2.0
Storage EngineWiredTiger (proprietary)PostgreSQL with JSONB
MongoDB Driver CompatibilityNativeCompatible
SQL AccessNoYes (via PostgreSQL tools)
Deployment FlexibilityModerateHigh (Docker, binary, cloud)
Production-ReadinessMatureEmerging (Rapidly improving)

Quickstart with Docker

FerretDB offers an all-in-one Docker image for evaluation:

docker run -d --rm --name ferretdb -p 27017:27017 \
  -e POSTGRES_USER=ferret \
  -e POSTGRES_PASSWORD=ferretpw \
  ghcr.io/ferretdb/ferretdb-eval:2

This image includes:

  • FerretDB proxy
  • Embedded PostgreSQL with DocumentDB extension
  • A MongoDB Shell for basic testing

Note: This setup is not suitable for production, as data is ephemeral. For persistent deployments, refer to the installation guides.

Supported Ecosystem and Use Cases

FerretDB is already supported on several platforms and PaaS providers, including:

  • FerretDB Cloud
  • Civo
  • Tembo
  • Elestio
  • Cozystack

It is ideal for:

  • SaaS providers needing MongoDB-like APIs without licensing limitations
  • DevOps teams managing multi-tenant architectures
  • Developers needing a flexible local database with SQL transparency

FerretDB is also available as an embeddable Go library, allowing advanced users to integrate its logic directly into backend services.

Community & Roadmap

FerretDB is under active development, with ongoing enhancements in aggregation support, replication logic, and performance. Contributions are welcome.


FerretDB presents a modern, pragmatic path forward for teams seeking MongoDB compatibility without the trade-offs of proprietary licensing. By harnessing the power of PostgreSQL and combining it with familiar NoSQL ergonomics, FerretDB creates a future-proof bridge between two data paradigms.

Whether you’re a startup embracing open source infrastructure or an enterprise architect designing sustainable cloud-native systems, FerretDB is worth a serious look.

Scroll to Top