explaingit

ferretdb/ferretdb

10,936GoAudience · developerComplexity · 3/5LicenseSetup · moderate

TLDR

Open-source MongoDB-compatible database that stores data in PostgreSQL underneath, so existing MongoDB applications connect without any code changes.

Mindmap

mindmap
  root((FerretDB))
    What it does
      MongoDB protocol
      PostgreSQL storage
      Translation layer
    Getting started
      Docker quickstart
      MongoDB Shell included
      Managed cloud options
    Use cases
      Replace MongoDB
      Self-hosted doc DB
      Embed in Go app
    Tech stack
      Go runtime
      PostgreSQL
      DocumentDB extension
    Audience
      Backend developers
      DevOps teams
      Open-source users
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Replace MongoDB in an existing app without changing any application code by pointing your driver at FerretDB instead.

USE CASE 2

Run a document database on PostgreSQL infrastructure you already own or manage.

USE CASE 3

Self-host a MongoDB-compatible database using one of several cloud providers or FerretDB's own managed service.

USE CASE 4

Embed a document database directly inside a Go application using the FerretDB Go library.

Tech stack

GoPostgreSQLDockerDocumentDB

Getting it running

Difficulty · moderate Time to first run · 5min

Quickstart needs Docker, production deployments require a separate PostgreSQL instance with the DocumentDB extension.

Open source under Apache 2.0, use freely for any purpose including commercial, keep the copyright notice.

In plain English

FerretDB is an open-source database that lets applications use MongoDB's language and tools while storing data in PostgreSQL underneath. MongoDB is a popular database for storing flexible, document-based data, but in 2018 it changed its license to one that restricts use in many open-source and early-stage commercial products. FerretDB was created to fill that gap: it speaks the same protocol as MongoDB, so any application or driver built for MongoDB can connect to FerretDB without code changes, but the data is actually stored in PostgreSQL using an extension called DocumentDB. The way it works is that FerretDB acts as a translation layer. Your application sends queries in MongoDB's format, FerretDB converts them to SQL, and PostgreSQL handles the actual storage. This means you get the document-database experience that MongoDB users are familiar with, but on top of a database engine that has a long history of open-source development and wide hosting support. Getting started is straightforward with Docker. A single command starts a container that includes FerretDB, a preconfigured PostgreSQL instance, and the MongoDB Shell for testing. You then connect using any standard MongoDB client pointed at the same address and port MongoDB normally uses. The README notes this single-container setup is for testing only, for real deployments, the documentation covers more durable installation options. Beyond the self-hosted version, several cloud providers offer managed FerretDB hosting, including FerretDB's own cloud service and platforms like Civo and Tembo. There is also a Go library that lets developers embed FerretDB directly inside a Go application. FerretDB is compatible with MongoDB 5.0 and later in many common use cases, though some advanced MongoDB features are not yet supported. A public compatibility list and roadmap are available in the project's documentation.

Copy-paste prompts

Prompt 1
Show me how to connect my existing MongoDB Node.js app to FerretDB running in Docker, what connection string do I use?
Prompt 2
Write a Docker Compose file that sets up FerretDB with a PostgreSQL backend for local development.
Prompt 3
Which MongoDB features are not yet supported by FerretDB, and how do I check the compatibility list?
Prompt 4
Generate a Go application that embeds FerretDB as an in-process document database instead of running it as a separate service.
Open on GitHub → Explain another repo

← ferretdb on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.