Understanding the differences between PgBouncer and Amazon RDS Proxy for PostgreSQL connection pooling | Amazon Web Services

Understanding the differences between PgBouncer and Amazon RDS Proxy for PostgreSQL connection pooling | Amazon Web Services

When hundreds of AWS Lambda invocations or microservice pods each open their own connection, PostgreSQL can run out of connections and memory long before it runs out of CPU. In this post we explain the differences between two popular connection poolers, RDS Proxy and PgBouncer. Connection pooling multiplexes many client connections onto a smaller set of PostgreSQL backends, helping prevent connection exhaustion under burst or microservices workloads. We show you how PgBouncer and Amazon RDS Proxy approach connection pooling for PostgreSQL and the trade-offs between a self-managed pooler and a fully managed service. PostgreSQL has several connection poolers. On AWS, two commonly used options are:

PgBouncer: a lightweight, open-source connection pooler you deploy and operate yourself.

Amazon RDS Proxy: a fully managed, Multi-AZ proxy service integrated with Amazon Relational Database Service (Amazon RDS) and Amazon Aurora.

Both support transaction-level…

https://aws.amazon.com/blogs/database/understanding-the-differences-between-pgbouncer-and-amazon-rds-proxy-for-postgresql-connection-pooling/