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

The principles and defects of MySQL full-text indexing

MySQL full-text index is a special index that gen...

Should I abandon JQuery?

Table of contents Preface What to use if not jQue...

How to modify iTunes backup path under Windows

0. Preparation: • Close iTunes • Kill the service...

Detailed explanation of MySQL EXPLAIN output columns

1. Introduction The EXPLAIN statement provides in...

In-depth explanation of slots and filters in Vue

Table of contents Slots What are slots? Slot Cont...

Summary of using the exclamation mark command (!) in Linux

Preface Recently, our company has configured mbp,...

Pure CSS to implement iOS style open and close selection box function

1 Effect Demo address: https://www.albertyy.com/2...

Solve the problem of blocking positioning DDL in MySQL 5.7

In the previous article "MySQL table structu...

Summary of Nginx load balancing methods

To understand load balancing, you must first unde...

Summary of MySQL stored procedure permission issues

MySQL stored procedures, yes, look like very rare...

How to safely shut down MySQL

When shutting down the MySQL server, various prob...