Is there an YSQL smart client for Golang?

[Question posted by a user on YugabyteDB Community Slack ]

Is there a YugabyteDB ‘smart client’ for Golang (that is cluster-aware and would avoid extra network hops)? Seems like it only exists for Java as of now.

Currently we don’t expose that information in the YSQL layer, you can follow this issue.

The way the Java version works, is by using the driver of YCQL to get cluster notifications, and update up/down servers. But it doesn’t have smart routing for YSQL like it does in YCQL.

For now you can use multiple hosts in connection string in pg client for fail-over when servers are down. And if you randomize that list of hosts on each new connection, you will spread connections across the cluster.