Is it possible to use two servers for same domain or database clone?

AI-generated summary

rahulMasal is asking if it’s possible to host two different databases for the same domain on different server machines or auto clone the database backup in different server machines. He also inquires about hosting the same domain on different server machines with automatic routing to a secondary server in case one goes down.

pfaffman suggests that auto cloning the database backup is not a supported solution, but refers to a potential workaround using PostgreSQL BDR. However, he notes that this might not be the best approach due to its outdated commit history. He confirms that hosting the same domain on different servers is possible using a load balancer or DNS.

Falco advises against using PostgreSQL BDR, as it’s a deprecated project and not supported by Discourse. He suggests that the topic rahulMasal is asking about is related to “High Availability” and refers to a relevant discussion: https://meta.discourse.org/t/high-availability-3-server-setup/180251?u=falco.

Dear Team,

Is it possible to host 2 different databases for same domain in different server machines? or is it possible to auto clone the database backup in different server machine?

or is it possible to host same domain on different server machines? so when one is down then auto route to secondary?

It’s not a supported solution, but one way to do that appears to be

https://github.com/discourse-org/postgres-bdr

edit: … except that seems to install pg9, which is odd because there is a commit in February, but that was a year ago, so maybe this isn’t a good idea. Or BDR is now supported without such heroic efforts. But I think that this isn’t the go-to place for advice on advanced Postgres configuration.

Yes, you can have multiple servers talking to the same database behind some kind of load balancer or dns pointing to both. But this isn’t the place to get advice on load balancing

PostgreSQL BDR isn’t a supported database for Discourse, and it’s a deprecated project (the open source version of it).

What you are asking about is named “High Availability” and there are a couple of topics about it: