Replace MongoDB in an existing app without changing any application code by pointing your driver at FerretDB instead.
Run a document database on PostgreSQL infrastructure you already own or manage.
Self-host a MongoDB-compatible database using one of several cloud providers or FerretDB's own managed service.
Embed a document database directly inside a Go application using the FerretDB Go library.
Quickstart needs Docker, production deployments require a separate PostgreSQL instance with the DocumentDB extension.
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.
← ferretdb on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.