Sample Header Ad - 728x90

Multi master vs leader-follower

1 vote
1 answer
763 views
Sorry if I ask this basic question. I am reading different articles and trying to understand how it works. Lets suppose I have two master DB(MySQL) in two different availability zone and two different region which are used for writing data and data is replicated in Synchronous way because I do not want any data to be lost during replication. And there are 4 slave (As per my understanding this is called Read replicas) which are used for reading the data. The data is replicated from Master to Slave as per the steps here https://dev.mysql.com/doc/internals/en/replication.html . Is it Synchronous or Asynchronous replication? The main purpose of multi-master setup as I understood is that in case one Master node is down then another Master node can be there always. But then I am thinking, why leader-follower algorithm is not used here, for example, lets suppose I have one Master node for writing purpose and 4 slaves for reading purpose in different Availability zone. The master DB is in Region US and AZ-1. But slaves DB And data is synchronized in the same way as before. Now, if the master node goes down then one of the slave node can become Master by implementing leader-follower algorithm. So, we do not need multi master. As per my understanding, in approach B there is a possibility that data can be lost if master node goes down. And also concurrent update into multiple Master node can cause data inconstancy. What are the pros and cons of this approach? Could you please give some use cases where both of the approaches fit.
Asked by Learner (11 rep)
Jun 27, 2022, 09:07 AM
Last activity: Dec 19, 2024, 06:09 PM