← Back to Patterns

How we decide between Cloud SQL connectors, Auth Proxy, and private IP

Cloud SQL connectors, the Auth Proxy, and private IP are not interchangeable secure connection options. They change identity, routing, deployment shape, and how much network plumbing the team actually owns.

By Ivan Richter LinkedIn

Last updated: Sep 1, 2026

4 min read

On this page

Cloud SQL language connectors, the Cloud SQL Auth Proxy, and private IP aren’t three mutually exclusive security options.

Private IP chooses the network route. A language connector or the Auth Proxy handles Cloud SQL connection authorization, certificate management, and optional automatic IAM database authentication. Either connector can itself use a private IP path when the runtime has VPC reachability.

The useful decision is therefore two decisions:

  1. How should traffic reach the instance?
  2. Where should Cloud SQL-specific connection behavior live?

Making those choices separately removes most of the vague “which one is more secure?” debate.

Choose the route first

For a private Cloud Run service in GCP, our default route is Cloud SQL private IP through Direct VPC egress. The database has no need for a public path, and reachability follows the VPC, subnet, firewall, DNS, and service egress design.

That route is easy to reason about when the platform already owns private networking. It also means network failures remain network failures: wrong subnet, exhausted addresses, missing route, firewall policy, DNS, or database-side private-services configuration.

A public IP path can still use a connector securely without authorized networks because the connector establishes the protected Cloud SQL connection. It may be the simpler route for local development or workloads that don’t belong on the VPC. Public IP isn’t automatically public database access. The connection method and instance policy still matter.

Private Service Connect can provide another private connection shape when its service-oriented network boundary is useful. Add it for that boundary, not because one more private acronym feels safer.

Language connectors keep the helper in process

The Go, Java, and Python Cloud SQL connectors integrate connection establishment into the application runtime. They’re a good fit when the language is supported, the service already uses provider-aware infrastructure, and automatic IAM database authentication or managed certificate refresh is useful.

The benefit is no companion process. The cost is Cloud SQL-specific code and library behavior inside the application. Startup, token refresh, connector metrics, and version compatibility become part of the runtime.

Use a language connector when that coupling makes the deployment simpler overall. Don’t wrap a generic application in provider-specific code merely to avoid one small process.

The Auth Proxy keeps the application generic

The Cloud SQL Auth Proxy is itself a Cloud SQL connector. It exposes a local TCP or Unix socket while handling the Cloud SQL side of authorization and encryption.

Use it when the application language lacks a connector, several runtimes need the same generic pattern, local tooling benefits from a localhost endpoint, or separating provider behavior from application code makes operations clearer.

The proxy is another process to start, observe, update, and restart. In Cloud Run it usually means a sidecar or another deployment integration. That cost is acceptable when it buys real compatibility.

The proxy doesn’t create network reachability. To use a private IP instance, the proxy still needs access to the VPC. It also doesn’t pool database sessions. Ten application connections through the proxy remain ten database connections.

Direct database connections keep every concern explicit

An application can connect directly to the private IP with a normal PostgreSQL driver. That keeps the runtime generic and removes the proxy, but the team now owns database credentials or IAM token handling, TLS configuration where required, certificate lifecycle, and connection-policy enforcement.

This can be the cleanest choice in a tightly controlled private network with mature secret and TLS handling. It can also be a false simplification that replaces a managed connector with bespoke credential scripts nobody wanted to maintain.

Count the whole operating path, not the number of containers in the manifest.

IAM database authentication is an identity choice

Automatic IAM database authentication through a language connector or Auth Proxy aligns the database login with the workload’s Google identity and refreshes short-lived tokens for the application.

Use it when service-account identity is the desired database principal and the connector lifecycle is acceptable. Keep conventional database users when portability, tooling, migration behavior, or connection scale makes them the more stable choice.

IAM authentication doesn’t replace database authorization. Roles and grants inside PostgreSQL still define what the principal may do.

Connection budgeting remains separate

None of these methods fixes pool sizing. A connector secures and authorizes the path. It doesn’t make backend sessions cheap.

Set per-instance pool limits, acquisition deadlines, max Cloud Run instances, and database headroom through the connection budget. Consider a pooler only when session multiplexing solves a measured problem.

Our default ladder

For Cloud Run services already using private networking:

  1. choose private IP through Direct VPC egress
  2. use a language connector when supported and IAM-oriented integration simplifies the service
  3. use the Auth Proxy when a generic local endpoint or unsupported runtime makes the sidecar worthwhile
  4. connect directly only when the team deliberately owns TLS and credential lifecycle

Break the route decision independently from the helper decision. A language connector over private IP and an Auth Proxy over private IP are both coherent designs.

The right combination is the one whose identity, network, startup, and incident paths the team can explain without collapsing them into the word “secure.”

More in this domain: Infrastructure

Browse all

Related patterns