0

I have created db instance in google cloud sql. After it was created, With the ip address assigned to it, my java servers are able to communicate with it in both read and write.

Now i created a failover replica and read replica of the db instance. As i am checking on dashboard two new instance of db got created with their respective ip addresses.

My understanding is my java servers need not to worry about the ip addresses of replica and failover replica. And will communicate with master db instance only. Read requests will automatically gets routed to slave from their only and similar to happen with failover replica.

Is my understanding is correct? Or is it my java servers responsibility to create individual read connection with the ip of slaves.

Please suggest the behaviour.

Rohit Sharma
  • 105
  • 1
  • 6

1 Answers1

1

If you want to spread reads to replicas, you will need to establish connections directly to the replicas. This won't happen automatically.

Vadim
  • 126
  • 2