PostgreSQL JDBC driver connection failover

The CockroachDB documentation recommends using either HAProxy or a load balancer solution from whichever provider is being used, i.e. On-premise, AWS, Azure, GCP.

Is there any caveat or reason against simply using the PostgreSQL JDBC driver connection failover features as documented at the bottom of this page ?

There’s no strong reason, but you’d have trouble when it comes to the cluster changing size or shape. You’d need to make sure applications would get restarted when the cluster changes, which might not be ideal for you.


Thanks for confirming Jordan.