FerretDB (previously MangoDB) was founded to become the de-facto open-source substitute to MongoDB. FerretDB is an open-source proxy, converting the MongoDB wire protocol queries to SQL - using PostgreSQL as a database engine.
MongoDB was originally an eye-opening technology for many of us developers, empowering us to build applications faster than using relational databases. In its early days, its ease-to-use and well-documented drivers made MongoDB one of the simplest database solutions available. However, as time passed, MongoDB abandoned its open-source roots; changing the license to SSPL - making it unusable for many open source and early-stage commercial projects.
Most MongoDB users do not require any advanced features offered by MongoDB; however, they need an easy-to-use open-source database solution. Recognizing this, FerretDB is here to fill that gap.
FerretDB will be compatible with MongoDB drivers and will strive to serve as a drop-in replacement for MongoDB.
Currently, the project is in its early stages and welcomes all contributors. See our public roadmap and contributing guidelines.
- FerretDB uses the same protocol error names and codes, but the exact error messages may be different in some cases.
If you encounter some other difference in behavior, please join our community to report a problem.
These steps describe a quick local setup. They are not suitable for most production use-cases because they keep all data inside containers.
- Store the following in the
docker-compose.yml
file:
version: "3"
services:
postgres:
image: postgres:14
container_name: postgres
ports:
- 5432:5432
environment:
- POSTGRES_USER=user
- POSTGRES_DB=ferretdb
- POSTGRES_HOST_AUTH_METHOD=trust
postgres_setup:
image: postgres:14
container_name: postgres_setup
restart: on-failure
entrypoint: ["sh", "-c", "psql -h postgres -U user -d ferretdb -c 'CREATE SCHEMA IF NOT EXISTS test'"]
ferretdb:
image: ghcr.io/ferretdb/ferretdb:latest
container_name: ferretdb
restart: on-failure
ports:
- 27017:27017
command: ["-listen-addr=:27017", "-postgresql-url=postgres://user@postgres:5432/ferretdb"]
networks:
default:
name: ferretdb
postgres
container runs PostgreSQL 14 that would store data.postgres_setup
container creates a PostgreSQL schematest
that would act like a FerretDB database of the same name.ferretdb
runs FerretDB.
-
Start services with
docker-compose up -d
. -
If you have
mongosh
installed, just run it to connect to FerretDB databasetest
. If not, run the following command to runmongosh
inside the temporary MongoDB container, attaching to the same Docker network:
docker run --rm -it --network=ferretdb --entrypoint=mongosh mongo:5 mongodb://ferretdb/
- Website and blog: https://ferretdb.io.
- Twitter: @ferret_db.
- Slack chat for quick questions.
- GitHub Discussions for longer topics.
- GitHub Issues for bugs and missing features.
- Open Office House meeting every Monday at 18:00 UTC at Google Meet.
If you want to contact FerretDB Inc., please use this form.