Is there a way where I can specify(include) both the master and slave server in nodejs db (postgresql) connecetion string in a replicated envirnment?
My aim is 'if master is down then the read/write should go to the slave'
Is there a way where I can specify(include) both the master and slave server in nodejs db (postgresql) connecetion string in a replicated envirnment?
My aim is 'if master is down then the read/write should go to the slave'
Even if nodejs does include this functionality(it shouldn't), you should really rely on something like pgpool to handle this. You can set it to favor the slave, for reads(or not), and configure it to push all writes to master.
This is really not something that should be handled by your framework.