Stacks / Backend
FerretDB + Postgres
Mongo-compatible documents on Postgres. FerretDB is Apache-2.0. MongoDB Community is SSPL — not OSI open source — so it is not the path.
The problem
MongoDB Atlas is a hosted cluster with a meter. MongoDB Community Server is SSPL, which OSI does not list as open source. FerretDB is Apache-2.0: it speaks the MongoDB 5.0+ wire protocol and stores data in PostgreSQL (DocumentDB extension). If you do not need the Mongo protocol, /stacks/go-pocketbase-htmx is the simpler app database.
Replaces
MongoDB Atlas
Estimated SaaS saved
$2,400
per year, small team, before lock-in
Start on RailwayGo + PocketBase if you can skip the Mongo protocol
Placeholder: FerretDB + the project's Postgres/DocumentDB image, data on a volume. Apps that do not need Mongo talk should use /stacks/go-pocketbase-htmx instead.
The stack
- FerretDB
Apache-2.0 MongoDB-compatible proxy on Postgres
- PocketBase
Embedded SQLite app database if you do not need Mongo
Cost table
| You stop paying | Typical / year | Self-host instead |
|---|---|---|
| MongoDB Atlas dedicated (small team) | $2,400 | FerretDB + Postgres |
Agent setup prompt
Replace MongoDB Atlas with FerretDB + PostgreSQL. Do not install MongoDB Community and call it open source — it is SSPL. - Follow FerretDB's production compose (FerretDB + the DocumentDB Postgres image). Persist Postgres on a volume. - Point one existing Mongo driver at the new URI. Confirm a find and an insert. - If the app can drop Mongo entirely, use /stacks/go-pocketbase-htmx instead. - Write AGENT_PROMPT.md.
Also as markdown: /stacks/ferretdb-mongo.md
FAQ
- Why not self-host MongoDB?
- MongoDB Community is SSPL. That is not an OSI open-source license. FerretDB is Apache-2.0 on Postgres. Compatibility is good for many apps — test your queries before you cut over.
- Why PocketBase then?
- If you do not need a Mongo driver, skip the proxy. PocketBase is the c17 app database. This page is for teams stuck on a Mongo client.