We are using the google spanner jdbc driver(google-cloud-spanner-jdbc) to enable connectivity from our application to cloud spanner. This was used instead of the google client libraries to reuse the existing code and framework which used jdbctemplate based data access. We have a multi region environment for applicaiton deployment . All looks ok until we see latency issues for connecting to spanner from one region. All write operations have a higher latency from the non primary region while its much lesser when calls to go the primary leade spanner.
Google documentation mentions to use “enableLeaderAwareRouting” to resolve this ,but that seems to be available only with google client libraries.
Do we have the same or equivalent configuration in the spanner Jdbc drivers as well ? I am not seeing anything from the driver documentation.
https://github.com/googleapis/java-spanner-jdbc/
Has anyone faced similar issues before,Any help greatly appreciated .
Read through the documenation on Google for Spanner driver , it does not explicity mention this option.
The option is mentioned in google client library pages,
https://cloud.google.com/spanner/docs/leader-aware-routing
Raj Kumar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.