Skip to main content
πŸŽ“ Claude Code Masterclass Learn AI-assisted development on Udemy β€” plus the companion book on Leanpub & Amazon. Start Learning
Supabase: The Open-Source Firebase Alternative with Real PostgreSQL
Platform Engineering

Supabase: The Open-Source Firebase Alternative with Real PostgreSQL

Supabase gives you PostgreSQL, Auth, Storage, Realtime, and Edge Functions β€” fully open-source and self-hostable on Kubernetes.

LB
Luca Berton
Β· 1 min read

What Is Supabase?

Supabase is a backend-as-a-service built on PostgreSQL. It gives you a database, auth, file storage, realtime subscriptions, edge functions, and vector search β€” all open-source. 78K+ GitHub stars.

Supabase vs Firebase

FeatureSupabaseFirebase
DatabasePostgreSQL (relational)Firestore (NoSQL)
Authβœ… (GoTrue)βœ…
Storageβœ… (S3-compatible)βœ…
Realtimeβœ… (PostgreSQL CDC)βœ…
Edge Functionsβœ… (Deno)βœ… (Node.js)
Vector searchβœ… (pgvector)❌
SQL queriesβœ… Full SQL❌
Self-hostedβœ…βŒ
Vendor lock-inNone (it’s just Postgres)High
Pricing modelPer-projectPay-per-read/write

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚             Supabase Platform               β”‚
β”‚                                             β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚  PostgRESTβ”‚ β”‚  GoTrue  β”‚ β”‚  Storage  β”‚  β”‚
β”‚  β”‚  (API)    β”‚ β”‚  (Auth)  β”‚ β”‚  (S3)     β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜  β”‚
β”‚        β”‚             β”‚             β”‚        β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚              PostgreSQL                β”‚  β”‚
β”‚  β”‚  + pgvector + pg_cron + pg_net        β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚                                             β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚ Realtime β”‚ β”‚  Kong    β”‚ β”‚   Edge    β”‚  β”‚
β”‚  β”‚ (CDC)    β”‚ β”‚(Gateway) β”‚ β”‚ Functions β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Self-Host on Kubernetes

# docker-compose for local dev / small deployments
services:
  db:
    image: supabase/postgres:15.6.1
    environment:
      POSTGRES_PASSWORD: your-super-secret-password
    volumes:
      - pgdata:/var/lib/postgresql/data

  auth:
    image: supabase/gotrue:v2.151.0
    environment:
      GOTRUE_DB_DRIVER: postgres
      GOTRUE_DB_DATABASE_URL: postgres://supabase_auth_admin:password@db:5432/postgres
      GOTRUE_JWT_SECRET: your-jwt-secret

  rest:
    image: postgrest/postgrest:v12.2.0
    environment:
      PGRST_DB_URI: postgres://authenticator:password@db:5432/postgres
      PGRST_JWT_SECRET: your-jwt-secret

  storage:
    image: supabase/storage-api:v1.0.6
    environment:
      STORAGE_BACKEND: s3
      GLOBAL_S3_BUCKET: your-bucket

  realtime:
    image: supabase/realtime:v2.28.32
    environment:
      DB_HOST: db
      DB_PORT: 5432

Key Use Cases

1. AI Applications (pgvector)

-- Enable vector extension
CREATE EXTENSION vector;

-- Store embeddings alongside data
CREATE TABLE documents (
  id UUID DEFAULT gen_random_uuid() PRIMARY KEY,
  content TEXT,
  embedding vector(1536),
  metadata JSONB
);

-- Semantic search
SELECT content, 1 - (embedding <=> query_embedding) as similarity
FROM documents
ORDER BY embedding <=> query_embedding
LIMIT 5;

2. Row-Level Security (Multi-tenant)

-- Each user sees only their data
ALTER TABLE projects ENABLE ROW LEVEL SECURITY;

CREATE POLICY "Users see own projects"
  ON projects FOR SELECT
  USING (auth.uid() = user_id);

CREATE POLICY "Users insert own projects"
  ON projects FOR INSERT
  WITH CHECK (auth.uid() = user_id);

3. Realtime Subscriptions

const channel = supabase
  .channel('orders')
  .on('postgres_changes', {
    event: 'INSERT',
    schema: 'public',
    table: 'orders',
  }, (payload) => {
    console.log('New order:', payload.new);
  })
  .subscribe();

Why PostgreSQL Matters

Unlike Firebase’s proprietary NoSQL, Supabase is just PostgreSQL:

  • Migrate away anytime with pg_dump
  • Use any PostgreSQL tool (DBeaver, pgAdmin, psql)
  • Join tables, use CTEs, window functions β€” real SQL
  • 40 years of battle-tested reliability
  • Extensions: PostGIS, pgvector, pg_cron, timescaledb
#Open Source #Database #Platform Engineering
Share:

πŸ“¬ Don't miss the next one

Get AI & Cloud insights delivered weekly

Join engineers getting practical tips on AI, Kubernetes, Ansible, and Platform Engineering.

Subscribe Free β†’
Luca Berton β€” AI & Cloud Advisor, Docker Captain

Luca Berton

AI & Cloud Advisor Β· Docker Captain Β· KubeCon Speaker

18+ years in enterprise infrastructure. Author of 8 technical books, creator of Ansible Pilot (1M+ YouTube views, 648K site users). Former Red Hat engineer. Speaker at KubeCon EU 2026 and Red Hat Summit 2026.

Free 30-min AI & Cloud consultation

Book Now