当前位置:网站首页>MySQL master-slave synchronous asynchronous replication semi synchronous replication full synchronous replication
MySQL master-slave synchronous asynchronous replication semi synchronous replication full synchronous replication
2022-06-29 12:24:00 【A little dog】
MySQL Master slave synchronization Asynchronous replication Semi-synchronous replication Full synchronous replication
To solve the problem of inconsistent master-slave synchronization
1、 Asynchronous replication
After the master database completes the commit transaction , Immediately execute asynchronously and return the result to the client , It doesn't matter whether it is received and processed from the library . If the processing is not received from the Library , There will still be inconsistency between master and slave data . period MySQL(5.5 before ) Only asynchronous replication is supported . And early support myisam engine .
2、 Semi-synchronous replication
The main library does not return to the client immediately after executing a transaction committed by the client , Instead, wait for at least one of the slave libraries to receive and write relay log Is returned to the client . As opposed to asynchronous replication , Semi-synchronous replication improves data security , At the same time, it also causes a certain degree of delay .
The emergence of semi synchronous replication , This is to ensure that the active and standby data are consistent at any time . As opposed to asynchronous replication , Semi synchronous replication requires the execution of every transaction , It is required that at least one standby database is successfully received , To return it to the user . The implementation principle is also very simple , After the local execution of the main database , Wait for the response message from the standby database ( It contains the latest data received by the standby database binlog(file,pos)), After receiving the standby database response message , And back to the user , Such a transaction is really completed . On the master database instance , There is a dedicated thread (ack_receiver) Receive the response message from the standby database , And notify the primary database and the standby database of the received logs through the notification mechanism , Can continue to execute .
3、 Full synchronous replication
When the master commits a transaction , All slave nodes must receive 、APPLY And commit these transactions , Then the main library thread can continue to do subsequent operations . Because you need to wait for all the transactions from the library to complete before returning , So the performance of full synchronous replication will be seriously affected .
Please correct me if there is any mistake
边栏推荐
- 亲测!Centos7部署PHP + Swoole
- Jerry's about TWS pairing mode configuration [chapter]
- Interview shock 61: tell me about MySQL transaction isolation level?
- Interpolated scatter data
- Pro test! Centos7 deploy PHP + spool
- oracle 19c : change the user sys/system username pasword under Linux
- 面试突击61:说一下MySQL事务隔离级别?
- 【JUC系列】同步工具类之ThreadLocal
- 黑化的蜜雪冰城,凭营销就想抓牢消费者的心?
- 每周推荐短视频:爱因斯坦是怎样思考问题的?
猜你喜欢

Ttchat x Zadig open source co creates helm access scenarios, and environmental governance can be done!

When you are young, you should be awake to fight, and when you are young, you should have the courage to try

The blackened honeysnow ice city wants to grasp the hearts of consumers by marketing?
![[leetcode] 14. Longest public prefix](/img/3b/3388ce8382ad5caaaf0a42488da2f9.png)
[leetcode] 14. Longest public prefix

An interpretable geometric depth learning model for structure based protein binding site prediction

百度云盘不限速下载大文件(2021-11亲测有效)

Interview shock 61: tell me about MySQL transaction isolation level?

Wonderful! Miaoying technology fully implements Zadig to help container construction, and fully embraces kubernetes and Yunyuan

Matlab GUI realizes the function of clicking the button, opening the file dialog box and importing pictures

【综合案例】信用卡虚拟交易识别
随机推荐
Dragon Book tiger Book whale Book gnawing? Try the monkey book with Douban score of 9.5
Jericho's position on initiating the connection back to the opposite ear: 【 chapter 】
GBase8s数据库select有ORDER BY 子句1
Interview shock 61: tell me about MySQL transaction isolation level?
一种可解释的几何深度学习模型,用于基于结构的蛋白质结合位点预测
ERP preparation of bill of materials Huaxia
MySQL数据库主从同步,一致性解决方案
ERP编制物料清单 金蝶
《自卑与超越》生活对你应有的意义
Gbase8s database into external clause
Gbase8s database for update clause
How can colleges and universities build future oriented smart campus based on cloud native? Full stack cloud native architecture vs traditional IT architecture
Pangolin编译error: ‘numeric_limits’ is not a member of ‘std’
ERP preparation of BOM basis
这个EMR-SparkSQL节点,他查询的表是不是ODPS的啊?
Take another picture of cloud redis' improvement path
GBase8s数据库对 STANDARD 或 RAW 结果表排序
Jerry's manual pairing method [chapter]
Installation and configuration of MariaDB
[leetcode] 14. Longest public prefix