Semi-synchronous replication in MySQL is a method of database replication that strikes a balance between the performance of asynchronous replication and the safety of synchronous replication. In semi-synchronous replication, the master waits for acknowledgment from at least one slave server before confirming that a transaction has been committed. This ensures that data is not lost in case of a master failure, while still allowing for some concurrency advantages over fully synchronous systems.
When a transaction is executed on the master server:
This replication method allows for better data integrity by ensuring that at least one copy of the data exists on a slave before confirming the operation.
-- On the master
CHANGE MASTER TO MASTER_HOST='slave_host', MASTER_USER='replication_user', MASTER_PASSWORD='password', MASTER_LOG_FILE='recorded_log', MASTER_LOG_POS=recorded_position;
START SLAVE;
-- On both master and slave
SET GLOBAL rpl_semi_sync_master_enabled = 1; -- Enable semi-synchronous replication on the master
SET GLOBAL rpl_semi_sync_slave_enabled = 1; -- Enable semi-synchronous replication on the slaves
How do I avoid rehashing overhead with std::set in multithreaded code?
How do I find elements with custom comparators with std::set for embedded targets?
How do I erase elements while iterating with std::set for embedded targets?
How do I provide stable iteration order with std::unordered_map for large datasets?
How do I reserve capacity ahead of time with std::unordered_map for large datasets?
How do I erase elements while iterating with std::unordered_map in multithreaded code?
How do I provide stable iteration order with std::map for embedded targets?
How do I provide stable iteration order with std::map in multithreaded code?
How do I avoid rehashing overhead with std::map in performance-sensitive code?
How do I merge two containers efficiently with std::map for embedded targets?