Content
Supabase Database Patterns
Supabase wraps Postgres with auth, real-time subscriptions, storage, and auto-generated APIs. This skill covers the database layer — schema design, RLS, migrations, indexing, and query optimization.
When to use
- Designing schema for a new Supabase-backed application
- Adding Row Level Security policies to protect data per-user or per-org
- Writing migrations that are safe for zero-downtime deployments
- Diagnosing slow queries and adding appropriate indexes
- Setting up connection pooling for serverless workloads
- Optimizing Postgres for high-read, low-write web app patterns
- Implementing soft deletes, audit trails, or temporal data patterns
When NOT to use
- Graph-shaped data that needs recursive traversals (consider a graph DB)
- Time-series at extreme write volume (consider TimescaleDB or ClickHouse)
- Full-text search as the primary access pattern (consider a dedicated search engine or a purpose-built BM25/vector service for large collections)
- Blob storage (use Supabase Storage or S3, not bytea columns)
- When the app only needs a key-value store (use Redis or KV)
Core concepts
Connection pooling
Supabase provides a managed server-side pooler (Supavisor) and exposes connection strings for pooled and direct modes. Understanding modes and ports is essential when designing apps that run on serverless or edge environments.
Key facts (Supavisor docs, last edited 2026-04-08):