Copy principle of Master-slave database: from MySQL website
1. Asynchronous
* After the master executes SQL, the binary bin-log file is logged.
* At the same time from the connection to the master server, and obtain Binlog from the master, stored in the local relay-log, and from the last remembered location from the execution of SQL;
* The primary server is executed after the Binlog is given, and does not confirm whether the data is received from the server;
2. Semi-asynchronous
* After the master executes SQL, the binary bin-log file is logged.
* At the same time from the connection to the master server, and obtain Binlog from the master, stored in the local relay-log, and from the last remembered location from the execution of SQL;
* The primary server waits for the data to be written to the local relay-log after the Binlog is given, and then begins execution;
mysql--Master-Slave database synchronization principle