Failover cluster replication

Master-replica replication allows us to have a simple setup for reads and writes at the potential risk of being unable to write to the master database. Master-master replication allows us to be able to read and write to the database even if one of the masters fail. However, the complexity of maintaining a consistent state across all the masters and the possible performance penalty can mean that it is not the ideal choice in all circumstances.

The failover cluster replication tries to take the middle ground by providing features of both replication strategies. It can be explained as follows:

  1. We take a cluster of databases.
  2. A database is assigned as the master depending on the master selection strategy used, which can vary from database to database.
  3. The remaining databases are assigned as the replicas.
  1. The master is responsible for updating the replicas with the latest state of the database.
  2. If the master fails for some reason, a selection is made to assign one of the remaining databases as the new master.

So which replication strategy should we use? It would be best to start with the simplest one, that is, the master-replica strategy because this will cover most of initial needs with great ease. Let us now see what our application would look like if we used the master-replica strategy for database replication:

An application with the master-replica database setup
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.101.81