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'
Server Fault is a question and answer site for system and network administrators. It only takes a minute to sign up.Sign up to join this community
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.