Discourse offers HA out of the box using global configuration.
See: GitHub - discourse/rails_failover · GitHub
And dig through global settings here: discourse/config/discourse_defaults.conf at main · discourse/discourse · GitHub
You would configure 2 pgbouncers in a high availability / enormous amount of connections required mode.