---
title: "NoSQL Postgres: Add MongoDB compatibility to your Supabase projects with FerretDB"
description: "FerretDB, an open source MongoDB-compatible proxy, can run on top of a Supabase Postgres database, storing each collection as a table in a `ferretdb` schema with documents as JSONB rows."
url: "https://swe.quest/articles/nosql-postgres-add-mongodb-compatibility-to-your-supabase-projects-with-ferretdb-44595afd7e1b96f1"
canonical: "https://supabase.com/blog/nosql-mongodb-compatibility-with-ferretdb-and-flydotio"
source: "Supabase"
published: "2024-01-31"
difficulty: "medium"
kind: "How-to"
reading_minutes: 4
tags: ["postgres","databases","containers"]
---

# NoSQL Postgres: Add MongoDB compatibility to your Supabase projects with FerretDB

A post on [Supabase](https://swe.quest/sources/supabase.md), published 2024-01-31, 4 min read, How-to. Original: [https://supabase.com/blog/nosql-mongodb-compatibility-with-ferretdb-and-flydotio](https://supabase.com/blog/nosql-mongodb-compatibility-with-ferretdb-and-flydotio)

## Summary

FerretDB, an open source MongoDB-compatible proxy, can run on top of a Supabase Postgres database, storing each collection as a table in a \`ferretdb\` schema with documents as JSONB rows. The walkthrough runs the FerretDB Docker image locally with \`FERRETDB\_POSTGRESQL\_URL\` pointed at a session-mode pooler connection string. It then connects with \`mongosh\` using PLAIN auth, performs inserts and updates, and inspects the resulting JSONB in the Supabase dashboard. For production it deploys FerretDB to Fly.io with a sample \`fly.toml\`, a secret for the database URL and a dedicated IPv4 address, which is a paid feature.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)
- [Databases](https://swe.quest/tags/databases.md) (Data & databases)
- [Containers](https://swe.quest/tags/containers.md) (Infrastructure)

## Prerequisites

- Docker basics ([easy posts on Containers](https://swe.quest/tags/containers.md?difficulty=easy))
- MongoDB shell usage
- Postgres connection strings ([easy posts on PostgreSQL](https://swe.quest/tags/postgres.md?difficulty=easy))

## Keywords

FerretDB, Supabase, MongoDB, mongosh, Fly.io, JSONB, Docker

## Related posts

- [Supabase Local Dev: migrations, branching, and observability](https://swe.quest/articles/supabase-local-dev-migrations-branching-and-observability-770def662fe57683.md): Supabase · 2023-08-08 · Easy · 6 min read · PostgreSQL, Developer tools, Schema migrations, Testing, Deployment
  Supabase's CLI gains a batch of Postgres local-development features: \`supabase inspect db\` with 19 diagnostic commands adapted from Heroku's pg-extras, \`db dump\` backups built on pg\_dump, migration squashing and diffing via migra, pgTAP testing with \`supabase test\`, plpgsql\_check linting, seeding, and TypeScript type generation that now detects foreign-key relationships.
- [Supabase Wrappers, a Postgres FDW framework written in Rust](https://swe.quest/articles/supabase-wrappers-a-postgres-fdw-framework-written-in-rust-284bf0f40798dcde.md): Supabase · 2022-12-15 · Medium · 9 min read · PostgreSQL, Rust, Data pipelines, Analytics & OLAP
  Supabase Wrappers is an alpha Rust framework, built on pgx, for writing Postgres Foreign Data Wrappers that expose external systems such as Stripe and Firebase as queryable foreign tables.
- [Migrating from the MongoDB Data API to Supabase](https://swe.quest/articles/migrating-from-the-mongodb-data-api-to-supabase-e9a02b6cce3743ea.md): Supabase · 2025-03-20 · Medium · 5 min read · PostgreSQL, Schema migrations, API design, Databases
  With MongoDB's Data API and HTTPS Endpoints reaching end-of-life on September 30, 2025, Supabase's auto-generated PostgREST API is offered as a near drop-in REST replacement.
- [Fly Postgres, managed by Supabase](https://swe.quest/articles/fly-postgres-managed-by-supabase-c2ddce21256b3097.md): Supabase · 2023-12-15 · Easy · 4 min read · PostgreSQL, Cloud platforms, Replication, Virtualization
  Supabase and Fly.io launched Fly Postgres, a managed Postgres running on Fly Machines (Firecracker VMs) with Supabase features like Supavisor pooling, pgvector, PITR, branching and auto-generated REST/GraphQL APIs; the offering has since been deprecated.
- [Getting started with Ruby on Rails and Postgres on Supabase](https://swe.quest/articles/getting-started-with-ruby-on-rails-and-postgres-on-supabase-03d6ca4747754aea.md): Supabase · 2024-01-29 · Medium · 3 min read · Ruby, PostgreSQL, Deployment
  A Rails app can be wired to a Supabase-hosted Postgres database by scaffolding with \`rails new -d=postgresql\` and supplying the Supabase pooler connection URI through the \`DATABASE\_URL\` environment variable.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
