Mysql replication principle and Function Analysis (), mysql2014-11-11
Replication Principle 1. The master writes data to the binlog. 2. slave enables two threads: I/O thread and SQL thread. 3. The slave I/O thread connects to the master and reads the binlog file name and position of the binlog on the master. 4. slave receives master change information through I/O thread and writes it to relay log. 5. read Relay log information through SQL thread and replay it to slave.
What does replication solve? I personally think that the main role of replication is: 1. Backup function, the slave database is a backup of the master database. 2. read/write splitting. The master database is mainly responsible for write operations and read operations from the slave database. 3. Load Balancing with multiple slave databases that can be read. 4. Master/Slave is the foundation of the high-availability architecture.