When it comes to connection pooling in the PostgreSQL world, PgBouncer is probably the most popular option. It’s a very simple utility that does exactly one thing – it sits between the database and the clients and speaks the PostgreSQL protocol, emulating a PostgreSQL server. A client connects to PgBouncer with the exact same syntax it would use when connecting directly to PostgreSQL – PgBouncer is essentially invisible.
PgBouncer is supported by almost every PostgreSQL DBaaS vendor, and widely used across the community. In this blog post, we’ll explain how PgBouncer works, the pros and cons of using it, and how to setup the connection pooler. If you’d like to know more about connection pooling in general, or wondering if it’s right for your deployment, check out our PostgreSQL Connection Pooling: Part 1 – Pros & Cons post.
How Does PgBouncer Work?
When PgBouncer receives a client connection, it first performs authentication on behalf of the PostgreSQL server. PgBouncer supports all the authentication mechanisms that PostgreSQL server supports, including a host-based-access configuration (note: we cannot route replication connections through PgBouncer). If a password is provided, the authentication can be done in two ways:
PgBouncer first checks the userslist.txt file – this file specifies a set of (username, md5 encrypted passwords) ...
Read More on Datafloq
No comments:
Post a Comment