AlloyDB Auth Proxy with Connection Pooling

Hey everyone!

I was looking at the new preview AlloyDB feature that supports connection pooling on port 6432. This is a really nice feature, but I’m unsure how it’s able to be used with AlloyDB Auth Proxy. Currently AlloyDB Auth Proxy only connects to AlloyDB on port 5433 (described here), and there doesn’t seem to be a way to change that.

Any help or suggestions about this would be appreciated!

AlloyDB’s built-in managed connection pooling doesn’t currently work with the AlloyDB Auth Proxy.

To use a connection pooler, you have two main options:

  • Direct Connection (Private IP): If your application is in the same Google Cloud VPC network as your AlloyDB cluster, you can connect directly to the database’s private IP address on port 6432. This is the simplest approach.
  • Run Your Own Pooler: You can run your own connection pooler (like PgBouncer) within your application’s environment. In this setup, your application connects to your PgBouncer instance, which then connects to AlloyDB via the Auth Proxy on the standard port (5433).