Getting started with Ruby on Rails and Postgres on Supabase
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. The walkthrough generates an Article scaffold, runs migrations, inserts and queries records from the Rails console, and routes the root path to the articles index. Deployment to Fly.io uses `fly launch` with Postgres provisioning set to none, the connection string stored as a Fly secret, and `fly deploy`.
Related posts
- Getting started with Laravel and Postgres
Supabase mediumAdeptA new Laravel app can be connected to a Supabase-hosted Postgres database in a few steps: scaffold the project with Composer, install Laravel Breeze for built-in authentication, set DB_CONNECTION=pgsql and DATABASE_URL to the Supabase pooler connection string, then run migrations and start the dev server. One Supabase-specific tip is to change Laravel's search_path from the public schema to a dedicated schema such as 'laravel', because Supabase exposes public through its data API. Breeze uses Laravel's own auth rather than Supabase Auth, so only database resources are billed.
- Fly Postgres, managed by Supabase
Supabase easyNoviceSupabase 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. Under the hood, Supabase packages all its services into a single All In One Docker image built from its Packer pipeline. Because Fly volumes lack network-attached storage, they are treated as ephemeral, with WAL-G continuously streaming WAL to S3 for recovery onto new hosts. Open issues include client IPs being masked by the Fly proxy, which breaks network restrictions, and inter-cloud bandwidth costs from backing up to AWS.
- Supabase Branching
Supabase mediumAdeptSupabase Branching gives each Git branch an isolated hosted Preview environment with its own Postgres database, Auth, Storage, Realtime, Edge Functions and APIs, plus separate credentials. A GitHub app runs migrations from ./supabase/migrations when a PR opens, applies new migration files incrementally on push, seeds from seed.sql, and runs the migrations against production on merge. It integrates with Vercel Preview deployments by auto-populating branch connection secrets. Early access is rolling out in batches to paid orgs, with copy-on-write snapshots, declarative config and automatic dashboard commits planned.
- Deploy a Dart App on Railway, Part 1
Railway mediumAdeptA Flutter + Serverpod trivia app is deployed to Railway with a Railway-hosted PostgreSQL database, using the Railway CLI and a custom multi-stage Dockerfile that compiles the Dart server and bundles a Flutter web build into Serverpod's static webserver. Database credentials are wired in through Railway variable references, and migrations are applied in production mode. Because Railway exposes only one port per domain, a Caddy reverse proxy template routes traffic between Serverpod's API port (8080) and web port (8082). A curl request to the example hello endpoint confirms the deployment works.
- NoSQL Postgres: Add MongoDB compatibility to your Supabase projects with FerretDB
Supabase mediumAdeptFerretDB, 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.