Semisynchronous Replication : MySQL's Proprietary Mechanism for Replication
First introduced in MySQL 5.5, Semisynchronous Replication offers a healthy alternative to MySQL Replication, which is asynchronous by nature. Here is how they differ:
MySQL Replication
- Master Executes SQL
- Master Records SQL Event in its Binary Logs
- Slave Reads SQL Event from Master Binary Logs
- Slave Stores SQL Event in its Relay Logs via I/O Thread
- Slave Reads Next SQL Event From Relay Log via SQL Thread
- Slave Executes SQL
- Slave Acknowledges Master of the Complete Execution of the SQL Event
Semisynchronous Replication
- Master Executes SQL
- Master Records SQL Event in its Binary Logs
- Slave Reads SQL Event from Master Binary Logs
- Slave Acknowledges Master of the Receipt of the SQL Event
- Slave Stores SQL Event in its Relay Logs via I/O Thread
- Slave Reads Next SQL Event From Relay Log via SQL Thread
- Slave Executes SQL
- Slave Acknowledges Master of the Complete Execution of the SQL Event
Benefits
- This permits a Slave to be closer sync'd to its Master
- If there are multiple Slaves, the Slave with the minimum ProcessID on the Master would be closer sync'd to its Master
- In the event of network latency, MySQL will switch back to standard asynchronous replication until network latency dissipates.