What are the advantages of MySQL MGR?

What are the advantages of MySQL MGR?

MGR (MySQL Group Replication) is a new feature added in version 5.7 and is a MySQL plug-in.

MGR is a new high-availability and high-scalability solution. The data of any node in the cluster is the same, and any node can be written, realizing true multi-master.

It mainly includes the following parts:

API layer: responsible for completing the interaction with MySQL Server, obtaining the Server status, and completing transaction management.

Component layer: mainly includes three specific components. Capture is responsible for collecting relevant information of transaction execution, Applier is responsible for applying cluster transactions to local, and Recovery is responsible for node data recovery.

Replication layer: responsible for conflict verification, receiving and applying cluster transactions.

Cluster communication layer: Cluster communication engine based on the Paxos protocol and interaction interface with upper-layer components.

MGR Group Replication:

Based on the defects of traditional asynchronous replication and semi-synchronous replication - data consistency cannot be guaranteed, MySQL officially launched Group Replication (MySQL Group Replication, MGR for short) in version 5.7.17.

A replication group is composed of several nodes. The submission of a transaction must be decided and passed by the majority of nodes (N/2 + 1) in the group before it can be submitted. As shown in the figure above, a replication group is composed of three nodes. The Consensus layer is the consistency protocol layer. During the transaction submission process, inter-group communication occurs. The transaction can only be submitted and responded to after two nodes have approved it.

The introduction of group replication is mainly to solve the problem of data inconsistency that may occur in traditional asynchronous replication and semi-synchronous replication. Group replication relies on a distributed consistency protocol (a variant of the Paxos protocol) to achieve eventual consistency of data in a distributed environment and provide a truly high-availability data solution (whether it is truly highly available remains to be discussed). The multi-write solution it provides brings us hope of realizing a multi-active solution.

MGR implements a distributed database architecture, and the underlying distributed foundation is the Paxos protocol. Paxos is used to ensure the submission order of transactions in distributed database systems. Although MGR will use the Slave channel, it only uses the execution thread (Applier Thread) of this channel to execute the Binlog Event sent remotely, and does not use this channel to transmit the Binlog Event. MGR does not use the Binlog Event transmission mechanism of asynchronous replication, nor does it use the MySQL service port for communication. MGR creates an independent TCP port for communication. The Group Replication plug-ins on each MySQL server are connected together through this port, and can communicate directly with each other.

The transmission of Binlog Event is not a simple point-to-point transmission like asynchronous replication. MGR uses the Paxos protocol when transmitting data. The Paxos protocol ensures the consistency and atomicity of data transmission. MGR builds a distributed state machine replication mechanism based on the Paxos protocol, which is the core technology for implementing multi-master replication.

Three main advantages:

1. Avoid split-brain: Split-brain will not occur in MGR (but be aware that network partitions may occur. MGR behaves slightly differently depending on the setting of the parameter group_replication_unreachable_majority_timeout=0/N).

2. Data consistency guarantee: MGR has excellent redundancy capabilities, which can ensure that Binlog Events are replicated to at least more than half of the members. As long as no more than half of the members fail at the same time, data loss will not occur. MGR also ensures that as long as the Binlog Event is not transmitted to more than half of the members, the local member will not write the transaction's Binlog Event into the Binlog file and commit the transaction, thereby ensuring that the downed server will not have data that does not exist on the online members in the group. Therefore, after a downed server is restarted, it can join the group without any special processing.

3. Multi-node write support: In multi-write mode, all nodes in the cluster can be written.

The above are the details of the advantages of MySQL MGR. For more information about MySQL MGR, please pay attention to other related articles on 123WORDPRESS.COM!

You may also be interested in:
  • How to configure MGR single master and multiple slaves in MySQL 8.0.15
  • Detailed explanation of mysql MGR single-master and multi-master mode switching knowledge points
  • mysql 8.0.18 mgr installation and its switching function
  • MySQL 8.0.18 uses clone plugin to rebuild MGR implementation
  • Detailed explanation of MySQL 5.7 MGR single master determination master node method
  • Common problems and solutions during MySQL MGR construction

<<:  Linux Jenkins configuration salve node implementation process diagram

>>:  How to detect file system integrity based on AIDE in Linux

Recommend

Detailed explanation of process management in Linux system

Table of contents 1. The concept of process and t...

Details of watch monitoring properties in Vue

Table of contents 1.watch monitors changes in gen...

Limit input type (multiple methods)

1. Only Chinese characters can be input and pasted...

How to solve the Docker container startup failure

Question: After the computer restarts, the mysql ...

MySQL 8.0.19 Installation Tutorial

Download the installation package from the offici...

CentOS 7.6 installation of MySQL 5.7 GA version tutorial diagram

Table of contents Environment Preparation Environ...

Detailed explanation of long transaction examples in MySQL

Preface: The "Getting Started with MySQL&quo...

Detailed explanation of several ways to create objects and object methods in js

This article is the second article about objects ...

Where is mysql data stored?

MySQL database storage location: 1. If MySQL uses...

How to get datetime data in mysql, followed by .0

The data type of MySQL is datetime. The data stor...

Two ways to open and close the mysql service

Method 1: Use cmd command First, open our DOS win...

A brief talk about MySQL semi-synchronous replication

Introduction MySQL achieves high availability of ...

Introduction to the use of em in elastic layout in CSS3: How many pixels is 1em?

I have been using CSS for a long time, but I have...

Summary of MySQL5 green version installation under Windows (recommended)

1 Download MySQL Download address: http://downloa...