This is the sixth day of my participation in the August Text Challenge.More challenges in August

MySQL supports three replication modes: asynchronous mode, semi-synchronous mode, and group replication mode.

1 MySQL Asynchronous Replication

Asynchronous replication is the earliest and most commonly used replication mode in MySQL. Asynchronous replication provides a simple master-slave replication method between a master and a standby (one or more). The master executes and commits a transaction, after which (hence the name asynchronous), These transactions are only re-executed on the slave library (based on statement) or change the data content (based on ROW), and the master library does not detect its synchronization on the slave library. In the case of high server load and high service pressure, master/slave generation delay has always been its criticism. The workflow diagram is as follows:

2 MySQL Semisynchronous Replication

Version MySQL5.5 implements a variant synchronization solution called semi-sync Replication as a plug-in on top of one-step synchronization. This plug-in adds a synchronous process on top of source-born asynchronous replication: the master is notified when changes (i.e., transactions) to the master are received from the slave. There are two types of operations on the main library: commit the transaction after receiving this notification; Release the session upon receipt. Both methods are determined by the specific configuration on the main library. Of from the library when the main library change notification, overtime by semi synchronous replication automatically switch to the asynchronous synchronization, thus greatly the ensures the consistency of data (at least one from the library), but the decline in performance, especially under the condition of the network is not stable, and a half to switch back and forth between synchronization and synchronization, has an impact on normal business. The workflow diagram is as follows:

3, Group Replication

Both asynchronous replication and synchronous replication, is a main one from or more from the pattern of below, under the high concurrency under high load, there is delay, at this time if the master node is abnormal, so will appear inconsistent data, data may be lost, in the financial level database should not be tolerated. In this case, a model is urgently needed to solve these problems. In MySQL5.7.17, with these expectations, a new replication mode group was replicated and GA was created (the test data for this article is based on MySQL5.7.17).

The flow chart of group replication is as follows: