scalability

Design scalable TypeScript + Supabase architectures with connection pooling and query hardening.

Updated Apr 16, 2026
One-click install
npx skills add https://github.com/jjmendezrodriguez/jm-claude-plugin --skill scalability-jjmendezrodriguez
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: scalability
Source: https://github.com/jjmendezrodriguez/jm-claude-plugin/tree/main/skills/scalability
Command: npx skills add https://github.com/jjmendezrodriguez/jm-claude-plugin --skill scalability-jjmendezrodriguez

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you prevent performance breakdowns and operational outages as a TypeScript + Supabase product grows from thousands to millions of users by guiding when to measure, optimize, and scale safely.

Core Features & Use Cases

  • Service-first architecture: separate thin request handlers from business logic and defer side effects so critical paths stay fast.
  • Connection pooling for Edge Functions: use Supavisor/pgBouncer transaction-mode patterns to avoid exhausting Postgres connections.
  • Read scaling & query hardening: select only needed columns, paginate results, add covering indexes, and cache invariant data before adding replicas.
  • Async workloads via queues: move slow side effects (emails, third-party webhooks, heavy processing) off the synchronous path using durable queue patterns.
  • Table partitioning strategy: partition large append-heavy tables (typically by time) only after measurable need, avoiding premature complexity.
  • Scaling order + monitoring checklist: follow a disciplined sequence (cache → indexes → vertical → horizontal → partition) with instrumentation and alerts.

Quick Start

Apply the scalability checklist to your new high-traffic endpoint by mapping the flow to service layers, validating query patterns and indexes, choosing pooled connection settings for Edge Functions, and queueing any operation that would push p95 latency beyond your target.

Frequently Asked Questions about scalability

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent Supabase Edge Functions from exhausting Postgres database connections?

To prevent exhausting Postgres connections in Supabase Edge Functions, configure connection pooling using Supavisor or pgBouncer in transaction-mode. This limits concurrent database connections and maintains low latency under heavy load.

What is the best order for scaling a Supabase application to handle high traffic?

The best order for scaling a Supabase application is caching invariant data, adding covering indexes, vertical scaling, horizontal scaling, and finally table partitioning. This sequence ensures measured scaling decisions and minimizes risk.

When should I use durable queues in a TypeScript and Supabase architecture?

Use durable queues in TypeScript and Supabase architectures to offload slow side effects like emails, third-party webhooks, and heavy processing. This moves asynchronous workloads off the synchronous path to keep critical request paths fast.

How do I optimize slow Supabase read queries before adding database replicas?

Optimize slow Supabase read queries by selecting only needed columns, paginating results, adding covering indexes, and caching invariant data. Hardening queries should be completed before adding read replicas.

When should I partition tables in PostgreSQL for multi-tenant growth?

Partition large append-heavy PostgreSQL tables by time only after a measurable performance need arises. Avoid premature table partitioning for multi-tenant growth to prevent unnecessary complexity until scaling limits are reached.