WordPress Backend HA (Automatic failover)

You can achieve automatic failover using a synchronous service, like Galera cluster.

It requires three nodes, but you can set up two nodes there, along with an arbitrator.