For RDBMS viz. MySql, PostgreSql a common solution for scalability and high availability is to run a primary instance as master that is a read-write instance and one or more read replicas. If the master fails, a failover happens and one of the read replicas become the master. The problem happens, when a network partition separates the master from the replicas. The clients keep writing to the master and the failover also happens resulting in two masters. One recommended solution for avoiding such split brain situation is to kill the old master. I think this is still acheivable. If we run some local agents in each server node forming a quorum (maybe using Zookeeper), we can kill the leader that cannot reach the majority.

But I think the most difficult part is that when the server wakes up, it seems it still believes that it is the master.

If we look at all the other open source projects, almost everyone uses Zookeeper which seems pretty safe when it comes to preventing a split-brain situation.

Systems that don't use Zookeeper, uses some other quorum based solutions. For e.g. Redis. If it runs in stand alone mode, it uses Sentinel to form the quorum. If it runs in cluster mode, it uses all the masters to form the quorum.

My question is, why MySql and PostgreSql are not implementing a similar solution. Is there any technical constraint for RDBMS in general? Is there any future plan?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.