A brief introduction to MySQL InnoDB ReplicaSet

A brief introduction to MySQL InnoDB ReplicaSet

01 Introduction to InnoDB ReplicaSet

InnoDB ReplicaSet was introduced in MySQL 8.0, which provides the replication features we are familiar with. If you have the concept of MongoDB replica set, it will be easier to understand InnoDB ReplicaSet.

InnoDB ReplicaSet uses the following techniques:

1. MySQL Shell, a more powerful client

2. MySQL Router, a lightweight middleware, can be compared to the role of mongos in MongoDB;

3. MySQL Server, also known as MySQL service

InnoDB ReplicaSet, hereinafter referred to as innodb replica set. It uses MySQL's replication technology. The replica set has a primary node and one or more secondary nodes. It does not provide fault self-healing and multi-master mode like InnoDB cluster (InnoDB cluster is another MySQL high availability solution), but it provides manual methods to add, remove and configure related nodes.

We usually use AdminApi in MySQL Shell to manage innodb replica sets. AdminAPI has two versions, js and python. We can easily write scripts to automatically deploy MySQL. AdminAPI provides an effective modern interface for MySQL instance sets, enabling you to provision, manage, and monitor deployments from a central tool.

InnoDB replica set supports MySQL Clone component. We can use the clone plug-in to easily build a replica set.

InnoDB ReplicaSet is tightly integrated with MySQL Router, and you can use AdminAPI to work with them. MySQL Router can automatically configure itself based on InnoDB ReplicaSet, a process called bootstrapping, so there is no need to manually configure the router.

02 Limitations of InnoDB ReplicaSet

The above introduces some basic knowledge and concepts of InnoDB replica set. Here we need to talk about its limitations. The limitations of InnoDB replica set are mainly reflected by comparing with InnoDB cluster. Let's list them below:

1. There is no automatic fault switching function. If the primary database is unavailable, you need to use AdminApi to manually trigger failover;

2. It is impossible to prevent data loss due to accidents or unavailability. When a failure occurs, transactions that have not been applied may be lost.

3. It is impossible to prevent data inconsistency after unexpected exit; when the master node is temporarily disconnected due to network problems, if a slave node is promoted to the master node, a brain split may occur;

4. InnoDB replica sets do not support multi-master mode, and the classic multi-master write replication solution cannot guarantee data consistency;

5. InnoDB replica sets are based on asynchronous replication and cannot perform flow control like MGR, so the read scalability will be limited to a certain extent;

6. All secondary instances must be replicated from the primary instance, so this may have a certain impact on the source instance.

It is not difficult to see from the above description that there is still a big gap between InnoDB replica sets and MongoDB replica sets, but we still need to study it because it is an important step taken by MySQL officials on the road to high availability. With the subsequent iteration of versions, I believe these problems will be paid attention to and solved, and there will be better solutions to further meet user requirements.

03 Things to know before deployment

The operating environment of the InnoDB replica set has certain requirements, as follows:

1. Only supports MySQL 8.0 and above;

2. Replication method that only supports GTID

3. Only row format binlog is supported, not statement format binlog

4. No support for copying filters

5. Do not allow the establishment of additional replication channels

6. There is only one primary node in the replica set, and there can be multiple secondary nodes. MySQL Router will monitor each node

7. The replica set must be managed entirely by MySQL Shell. Configuration and changes to the instance outside of MySQL Shell are not supported.

In the next article, I will start with the most basic installation process and describe in detail the installation of MySQL Shell, MySQL Router, and the process of setting up an InnoDB replica set.

The above is a brief introduction to MySQL InnoDB ReplicaSet. For more information about MySQL InnoDB ReplicaSet, please pay attention to other related articles on 123WORDPRESS.COM!

You may also be interested in:
  • MySQL Innodb key features insert buffer
  • Detailed explanation of memory management of MySQL InnoDB storage engine
  • MySQL InnoDB transaction lock source code analysis
  • Detailed Introduction to MySQL Innodb Index Mechanism
  • Detailed explanation of various locks in the InnoDB storage engine in MySQL
  • MySQL storage engines InnoDB and MyISAM
  • How to solve phantom read in innoDB in MySQL

<<:  Optimizing JavaScript and CSS to improve website performance

>>:  Introduction to Semantic XHTML Tags

Recommend

Add crontab scheduled tasks to debian docker container

Now most of the Docker images are based on Debian...

Master-slave synchronous replication configuration of MySQL database under Linux

The advantage of the master-slave synchronization...

Two ways to build Docker images

Table of contents Update the image from an existi...

Understanding and using React useEffect

Table of contents Avoid repetitive rendering loop...

Detailed explanation of the reasons why MySQL connections are hung

Table of contents 1. Background Architecture Prob...

Implementation code of front-end HTML skin changing function

50 lines of code to change 5 skin colors, includi...

Understanding the CSS transform-origin property

Preface I recently made a fireworks animation, wh...

Solution to JS out-of-precision number problem

The most understandable explanation of the accura...

Detailed explanation of how to access MySQL database remotely through Workbench

Preface Workbench is installed on one computer, a...

Why is the disk space still occupied after deleting table data in MySQL?

Table of contents 1. Mysql data structure 2. The ...

Solution to the problem "Table mysql.plugin doesn't exist" when deploying MySQL

Today I deployed the free-installation version of...

Detailed installation instructions for the cloud server pagoda panel

Table of contents 0x01. Install the Pagoda Panel ...

Use of select, distinct, and limit in MySQL

Table of contents 1. Introduction 2. select 2.1 Q...