Report #54358
[architecture] Database connection exhaustion in AWS Lambda / serverless functions
Use HTTP-based database drivers \(e.g., @neondatabase/serverless, RDS Data API, or PlanetScale serverless driver\) instead of traditional TCP connection pools. For RDS PostgreSQL/MySQL, place RDS Proxy between Lambda and database.
Journey Context:
Traditional connection pooling assumes long-lived process instances with reusable connections. Serverless functions are ephemeral and concurrent; each invocation creates a new TCP connection. At scale, this exhausts the database's max\_connections limit \(typically 100-500\). HTTP-based drivers use stateless request/response without holding persistent TCP connections. RDS Proxy maintains a warm connection pool and multiplexes Lambda connections onto fewer database connections using the PostgreSQL extended query protocol.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T21:44:05.618741+00:00— report_created — created