/supabase-pack:supabase-load-scalefrom supabase-pack
Scales Supabase projects for production load: read replicas, Supavisor connection pooling, compute upgrades, Storage CDN, Edge Function regions, and table partitioning.
Ships in supabase-pack. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Supabase scaling operates at six layers: read replicas (offload analytics
and reporting queries), connection pooling (Supavisor, the pgBouncer
replacement, with transaction/session modes), compute upgrades (vCPU/RAM
tiers), CDN for Storage (cache public bucket assets at the edge), Edge
Function regions (deploy functions closer to users), and table
partitioning (split billion-row tables for query performance). This skill
gives the high-level workflow inline and links to references/ for the full
createClient config, SQL, and CLI for each layer.
@supabase/supabase-js v2+ installedsupabase CLI installed and linked to your projectpsql or Supabase SQL EditorRoute read-heavy queries (dashboards, reports, search) to a read replica while
keeping writes on the primary. Supavisor pools connections in two modes:
transaction (default, port 6543 — shares connections, no prepared
statements) and session (port 5432 — one connection per client, needed for
prepared statements and LISTEN/NOTIFY). Configure two clients — a primary
and a read-only replica pointed at the -ro URL:
// lib/supabase.ts
export const supabase = createClient<Database>(
process.env.SUPABASE_URL!, process.env.SUPABASE_ANON_KEY!) // writes + realtime
export const supabaseReadOnly = createClient<Database>(
process.env.SUPABASE_READ_REPLICA_URL!, process.env.SUPABASE_ANON_KEY!) // analytics
Then send analytics queries to supabaseReadOnly and all writes to supabase.
Replicas lag slightly (typically <100ms), so never read-after-write on a
replica. Full client config, pooled psql connection strings, query-routing
services, and a pool-usage monitoring query:
read replicas and connection pooling.
Match the current project compute configuration to measured traffic, serve public
Storage buckets through the CDN with long cacheControl headers plus
content-addressed paths for cache busting, and deploy Edge Functions to the
appropriate execution region:
supabase functions deploy my-function workflow.Compute selection workflow, CDN upload/transform patterns, versioned-asset cache busting, and the regional geo-router Edge Function: compute, CDN, and edge regions.
Split large append-heavy tables (events, logs, metrics) by date range so
queries scan only the relevant partitions and old data drops cheaply. See
table partitioning patterns for range
partitioning by date, automated partition creation via pg_cron, SDK query
patterns with partition-key filters, and partition drop for data retention.
| Issue | Cause | Solution |
|---|---|---|
too many connections for role | Exceeded Supavisor pool limit | Use transaction mode (port 6543), reduce idle connections, upgrade compute |
| Read replica returns stale data | Replication lag (typically <100ms) | Do not read-after-write on replica; use primary for consistency-critical reads |
no partition of relation "events" found for row | Insert date outside any partition range | Create a DEFAULT partition or pre-create future partitions |
| Storage CDN returns old file | Cached at edge | Use content-addressed paths (hash.ext) or set shorter cacheControl |
| Edge Function cold start | First request to a region | Use keep-alive cron ping or accept ~200ms cold start |
prepared statement already exists | Transaction mode doesn't support prepared statements | Switch to session mode (port 5432) or disable prepared statements in your ORM |
# Check how many connections are in use right now
psql "$DATABASE_URL" -c "SELECT count(*) AS active_connections FROM pg_stat_activity WHERE state = 'active';"
For deeper worked examples — swapping an existing table to a partitioned one (create/migrate/rename in a transaction) and measuring live read-replica lag — see advanced scaling examples.
For reliability patterns (circuit breakers, offline queues, graceful degradation), see supabase-reliability-patterns.
references/advanced-examples.md (opens in a new tab)references/capacity-planning.md (opens in a new tab)references/cdn-and-edge.md (opens in a new tab)references/connection-pooling.md (opens in a new tab)references/errors.md (opens in a new tab)references/examples.md (opens in a new tab)references/load-testing-with-k6.md (opens in a new tab)references/scaling-patterns.md (opens in a new tab)references/table-partitioning.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
30 skills in this plugin
/supabase-advanced-troubleshootingDeep Supabase diagnostics: pg_stat_statements for slow queries, lock debugging
with pg_locks, connection leak detection, RLS policy conflicts, Edge Function
cold starts, and Realtime connection drop analysis.
Use when standard troubleshooting fails, when investigating performance
regressions, when debugging race conditions, or when building evidence for a
Supabase support escalation.
Trigger with "supabase deep debug", "supabase slow query", "supabase lock
contention", "supabase connection leak", "supabase RLS conflict", "supabase
cold start".
/supabase-architecture-variantsUse when choosing how to integrate Supabase into a specific stack — setting up
Next.js SSR auth flows, wiring an SPA or React Native client, configuring mobile
deep links, or designing multi-tenant data isolation. Covers where the client runs
(browser vs server) and which key it uses (anon respects RLS, service_role bypasses it).
Trigger with phrases like "supabase next.js", "supabase SSR", "supabase react native",
"supabase SPA", "supabase serverless", "supabase multi-tenant", "supabase server component",
"supabase architecture", "supabase service_role server".
npx claudepluginhub jeremylongshore/tons-of-skills-marketplace --plugin supabase-packOther plugins' skills for the same job