Connections & pooling (Supavisor)
DevLog works perfectly on your machine, then you deploy it to Vercel and every third request starts failing with FATAL: remaining connection slots are reserved for non-replication superuser connections. You didn't change a line of application code. What changed is that a serverless platform runs your database query in a fresh function invocation, and a fresh invocation means a fresh Postgres connection — dozens of them, all at once, all fighting over a limit that was never designed for that traffic shape.
try to break it
you drive.
Transaction mode: a slot is returned to the pool the instant a transaction commits. All 6 requests finish, in waves of 3 — Postgres never sees more than 3 connections at once, no matter how many clients call in. The price: nothing about a client survives between its own statements, so a second query from the same request may land on a differentbackend connection. Prepared statements, `SET`, and session-scoped state don't travel with it.