We are making a move towards cloud deployment right now, and in that process would like to create some read replicas for our database.
I am confused as to what the suggested method for balancing requests between Cloud SQL read replicas. It seems that the Cloud SQL Proxy may be the correct method, but it is unclear to me how it should be used in a production environment.
As you can see here (Does Cloud SQL provide load balancing for requests to read replicas?) "Cloud SQL does not automatically provide or configure load balancing. You can use connection pooling to distribute read requests between read replicas by switching between multiple connection endpoints".
Your code should look like this in case your want to use Unix sockets
And the following example is for TCP connections