Serverless PostgreSQL is phenomenal for shipping fast. Branching, automatic scaling, and zero maintenance make it an easy default when spinning up a new Node.js backend.
Until you inspect your tail latencies in production.
When we audited our API telemetry, our p95 query latency was sitting at 914ms . Even simple indexed lookups were occasionally stalling for nearly a full second.
We migrated that workload from a cross-region serverless Postgres setup to a co-located Docker PostgreSQL 18 instance sitting behind PgBouncer 1.26 in transaction mode. The result: our p95 latency dropped from 914ms to 2ms .
Before jumping to "serverless is slow, self-host everything," it is important to isolate where those 912 milliseconds actually went—because most of the win comes from fixing geography and lifecycle states, while the final drop from 9ms to 2ms comes from local NVMe and connection pooling.
Step 1: Auditing Where the 914ms Actually Went
Blaming the database engine for a 914ms p95 is almost always wrong.…