MySQL master-slave architecture and read-write separation practice

1. MySQL master-slave architecture

1、MySQL Replication

1. What is MySQL Replication?

1) Replication can replicate data from one database server (master) to one or more database servers (slave);

2) By default, it belongs to asynchronous replication, and there is no need to maintain long connections;

3) Through configuration, you can copy all libraries or several libraries, or even some tables in the library;

4) It is built-in in MySQL and comes with itself;

2. The principle of Replication

Simply put, the master writes the database changes to the binary log, and the slave synchronizes these binary logs and performs data operations based on these binary logs.

DML: SQL operation statement update, insert, delete.

Relay log: relay log.

3. The role of Replication 

1) Fail Over failover;

2) Backup Server backup service, unable to recover from failures caused by SQL statement execution, limited backup;

3) High Performance, multiple slaves can be used to achieve read and write separation;

4. Rep

Guess you like

Origin blog.csdn.net/qq_35029061/article/details/132133505