Open terencechow opened 6 years ago
Hi @terencechow sorry you haven't gotten a response yet. I am not very familiar with the pool cluster implementation, and the docs are quick lacking (partly because I don't really know enough about it to write docs and none have been contributed yet). If I find some time, I will try to research your issue is no one else responds.
I'm trying to understand the
poolCluster
as I am in the process of setting up mysql services for production. I use Google Cloud SQL and they provide an automatic failover option. The automatic failover should be read-only not write.My code currently uses pools like so:
elsewhere: used like
pool.query
...If I use poolCluster do I have to get a pool each time?
Does
poolCluster.of('*')
select a new pool each time a query is actually called? Or does the above implicitly grab only 1 pool since I've only calledpoolCluster.of('*')
once and exported it? (Implicitly this means I'll need to add a lot ofpoolCluster.of('*')
everywhere in my code and I'm hoping that isn't the case.Also if I use
poolCluster.of('*')
and proceed to make a write query, will it implicitly select the pool that can take writes? Or do we need to specifcy the pool that can take writes?