PgBouncer Connection Pooling
ArmorDB includes a built-in PgBouncer instance for every database. This allows your application to maintain thousands of connections without exhausting the memory of the underlying PostgreSQL process.
Transaction Mode
Our PgBouncer is configured in Transaction Mode by default. This is the most efficient mode for modern web applications and serverless functions.
How it works
Connections are assigned to a server process only for the duration of a transaction. Once the transaction ends, the connection is returned to the pool for another client to use.
Best Practices
Serverless Functions
Serverless environments (AWS Lambda, Vercel Functions) create many short-lived connections. Always use the pooled port to avoid 'Too many connections' errors.
Connection Strings
The dashboard provides two connection strings: one for direct access (rarely needed) and one for the pooled gateway. Use the pooled version for production.
Prepared Statements
In transaction mode, server-side prepared statements are not supported. Use client-side prepared statements or your ORM's equivalent.
