当前位置:网站首页>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
边栏推荐
- iMile 利用 Zadig 多云环境周部署千次,跨云跨地域持续交付全球业务
- Easy express: we use Zadig to realize 10000 times of construction and deployment, smart operation and maintenance, and release development productivity
- Pro test! Centos7 deploy PHP + spool
- GBase8s数据库在组合查询中的集合运算符
- TTChat x Zadig 开源共创 Helm 接入场景,环境治理搞得定!
- 亲测!Centos7部署PHP + Swoole
- Li Kou daily question - day 31 -1779 Find the nearest point with the same X or Y coordinate
- 535. TinyURL 的加密与解密 : 设计一个 URL 简化系统
- 《Go题库·14》WaitGroup的坑
- ERP preparation of BOM basis
猜你喜欢

如何查看网站已经保存的密码

妙!妙盈科技全面实施 Zadig 助力容器化建设,全面拥抱 Kubernetes 和云原生

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

亲测!Centos7部署PHP + Swoole

基于字节码的统一异常上报实践

Do you think people who learn machinery are terrible?

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

谷粒商城项目
![Jerry's configuration of TWS cross pairing [chapter]](/img/35/a041093ce3dab8e2739bbc1466ba29.png)
Jerry's configuration of TWS cross pairing [chapter]

ERP preparation of BOM basis
随机推荐
年轻就要醒着拼,年轻就要勇于尝试
参加2022年杭州站Cocos Star Meetings
Gbase8s database select has order by Clause 4
Take another picture of cloud redis' improvement path
ERP Kingdee for preparing BOM
What is the main account of Chia Tai futures used for 4 quotation software?
Easy express: we use Zadig to realize 10000 times of construction and deployment, smart operation and maintenance, and release development productivity
Numpy's ndarray array Foundation
Gbase8s database select has order by Clause 6
[leetcode] 14. Longest public prefix
Kyligence Zen, an intelligent indicator driven management and decision-making platform, is newly launched and is in limited internal testing
嵌入式数据库开发编程(四)——DDL、DML
《自卑与超越》生活对你应有的意义
How to obtain method parameter values through WinDbg
Imile uses Zadig's multi cloud environment to deploy thousands of times a week to continuously deliver global business across clouds and regions
Unified exception reporting practice based on bytecode
Gbase8s database select has an order by clause
Jerry's configuration of TWS cross pairing [chapter]
& 4 express framework
智能指标驱动的管理和决策平台 Kyligence Zen 全新上线,限量内测中