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 the TLS-protected pooled connection string at db.armordb.org:6432. Direct TLS access is available at db.armordb.org:5432 for migrations and session-level features. Use sslmode=verify-full to verify the gateway certificate.
Prepared Statements
In transaction mode, server-side prepared statements are not supported. Use client-side prepared statements or your ORM's equivalent.
