Add a fallback for postgres database

My setup information:

Machine 1:

All the sentry related docker containers are running on this machine(web, worker and cron)

Machine 2:

Postgres and redis containers are running on this machine. Sentry containers are connected via IP and port to this machine.

Machine 3:

I am planning to create a master-slave system for Postgres with machine 1 being the master and this as a slave.

My query:

Is there any way I can provide machine 3(IP:port) for postgres connection to sentry as a fallback if for some reason machine 2 is down or for some reason connection fails.

Scaling the backend database is not in the scope of the Sentry on-premise project as it is quite complicated and there isn’t a one-size-fits-all solution. If you need such a thing, you may look into auto-scaling cloud-hosted DB solutions like Amazon RDS or consider adding pgbouncer or haproxy into your setup. Even then, determining a master fail and doing a seamless fail over is a very tricky problem so be ready to have many failures before succeeding.

Thanks @BYK for your response. It really helps

1 Like