How can I set database failover portal with Sequelize?

501 Views Asked by At

I am using sequelize to connect to a postgres db which is hosted on compose.io.

const db = new Sequelize(DATABASE_URL, {
  logging: false,
  pool: {
    max: 15,
    min: 1,
    idle: 10000,
    acquire: 10000,
  },
});

How can I set a failover portal?

postgres://[username]:[password]@gcp-us-east1-cpu.2.dblayer.com:16070/compose
postgres://[username]:[password]@gcp-us-east1-cpu.0.dblayer.com:16070/compose
0

There are 0 best solutions below