当前位置:网站首页>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
边栏推荐
- GBase8s数据库select有HAVING 子句
- After class assignment of module 5 of the construction practice camp
- 《Go题库·14》WaitGroup的坑
- Go高级工程师必修课 | 真心建议你来听听,别错过~
- Li Kou daily question - day 31 -1779 Find the nearest point with the same X or Y coordinate
- 架构实战营第五模块课后作业
- ShanDong Multi-University Training #3
- GBase8s数据库对 STANDARD 或 RAW 结果表排序
- GBase8s数据库FOR UPDATE 子句
- 求大数的阶乘 ← C语言
猜你喜欢

When a technician becomes a CEO, what "bugs" should be modified?

【JUC系列】同步工具类之ThreadLocal

oracle 19c : change the user sys/system username pasword under Linux

【综合案例】信用卡虚拟交易识别

Artbench: the first class balanced, high-quality, clean annotated and standardized artwork generation data set

ERP编制物料清单 金蝶

& 3 view request message and response message in browser

How can colleges and universities build future oriented smart campus based on cloud native? Full stack cloud native architecture vs traditional IT architecture

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

文件包含之日志中毒(User-Agent)
随机推荐
GBase 8s 扩展外连接1
一种可解释的几何深度学习模型,用于基于结构的蛋白质结合位点预测
高校如何基于云原生构建面向未来的智慧校园?全栈云原生架构VS传统IT架构
Pangolin compilation error: 'numeric_ limits’ is not a member of ‘std’
文件包含之日志中毒(User-Agent)
内插散点数据
ERP编制物料清单 金蝶
The blackened honeysnow ice city wants to grasp the hearts of consumers by marketing?
& 3 view request message and response message in browser
torch.load加载模型报错:Can‘t get attribute ‘vae_vc‘ on <module ‘__main__‘ from ‘xxxx()运行文件路径‘
&3 在浏览器中查看请求报文和响应报文
How to obtain method parameter values through WinDbg
什么是外链和内链?
After class assignment of module 5 of the construction practice camp
Quick look | the long-awaited 2022 Guangzhou assistant testing engineer's real problem analysis is finally released
Jerry's about TWS channel configuration [chapter]
ERP Kingdee for preparing BOM
钛动科技:我们的 Zadig 落地之路
求大数的阶乘 ← C语言
Gbase8s database for read only clause