当前位置:网站首页>Applicable Scenarios of Multi-Master Replication (1) - Multi-IDC
Applicable Scenarios of Multi-Master Replication (1) - Multi-IDC
2022-07-31 15:32:00 【HUAWEI CLOUD】
3 multi-master replication
Previously, it was a single-master master-slave replication architecture. Master-slave replication has an obvious disadvantage: there is only one master node, and all writes must go through it ^iv.In the event that the network with the master node is interrupted and it is impossible to connect to the master node, the master-slave replication scheme affects all DB write operations.
To expand the master-slave replication model, you can configure multiple master nodes, each of which can handle writes. The process of subsequent replication is similar: each [master node] that processes writes must forward the data changes.to all other nodes.This is multi-master (also known as master-master, or active/active) replication.At this time, each master node also acts as a slave node of other master nodes at the same time.
3.1 Applicable scenarios
Using multiple masternodes within an IDC doesn't make much sense, as the complexity outweighs the benefits.But in some cases, the multi-active configuration is also reasonable:
3.1.1 Multiple IDC
To tolerate an entire IDC level failure or closer to the user, a copy of the DB can be spread across multiple IDCs.However, if the conventional master-slave replication model is used, the master node must be located in one of the IDCs, and all write requests must go through this IDC.
With the multi-master node replication model, master nodes can be configured in each IDC, as shown in Figure-6. Basic architecture:
- In each IDC, master-slave replication is used
- Between IDCs, the master node of each IDC is responsible for data exchange and update with the master nodes of other IDCs
Single-master vs. multi-master when comparing multiple data centers:
Performance
- Single live, each write must traverse the Internet and enter the master node data center.This can greatly increase write latency and go against the original intention of setting up multiple data centers (nearest access)
- Multiple activities, each write operation can respond quickly in the local IDC, and then use asynchronous replication to synchronize changes to other IDCs.Therefore, the network delay between IDCs is effectively shielded for upper-layer applications, so that the performance experienced by end users is better
Tolerating data center downtime
Under master-slave replication, if the IDC where M is located fails, it must be switched to another IDC, and one of the slave nodes will be promoted to M.In the multi-master model, each IDC can continue to operate independently of other IDCs, and the failed data center is updated to the latest state after recovery.
Tolerating network issues
Communications between IDCs are usually over a wide area network, which is mostly not as reliable as the local network within the IDC.A single-master configuration is very sensitive to connectivity issues between datacenters because writes over this connection are synchronous.Multi-active configurations with asynchronous replication are generally better able to withstand network issues: temporary network outages do not prevent writes being processed.
Some databases support multi-master configuration by default, but it is also common to use external tools such as MySQL's Tungsten Replicator.
Although multi-master replication has these advantages, it also has a big disadvantage: two different IDCs may modify the same data at the same time, and write conflicts must be resolved (conflict resolution in Figure-6).
Since multi-master replication is only a new feature in many databases, there are still subtle configuration flaws, and interactions with other database features such as auto-incrementing primary keys, triggers, and integrity constraints sometimes occur unexpectedly.Therefore, many people feel that multi-master replication is dangerous and should be avoided as much as possible.
边栏推荐
- 更新数据表update
- 工程水文学试卷
- The use of border controls
- 删除 状态良好(恢复分区)的磁盘
- 女性服务社群产品设计
- Browser's built-in color picker
- Linux查看redis版本(查看mongodb版本)
- Female service community product design
- R language test whether the sample conforms to normality (test whether the sample comes from a normally distributed population): shapiro.test function tests whether the sample conforms to the normal d
- 多主复制的适用场景(1)-多IDC
猜你喜欢
OPPO在FaaS领域的探索与思考
DBeaver连接MySQL 8.x时Public Key Retrieval is not allowed 错误解决
Visualize GraphQL schemas with GraphiQL
对话庄表伟:开源第一课
网银被盗?这篇文章告诉你如何安全使用网银
第二届中国PWA开发者日
What is the difference between BI software in the domestic market?
工程力学复习资料
基于ABP实现DDD
After Grafana is installed, the web opens and reports an error
随机推荐
力扣:56. 合并区间
"Autumn Recruitment Series" MySQL Interview Core 25 Questions (with answers)
Doing things software development - the importance of law and understanding of reasonable conclusions
TRACE32——C源码关联
C语言”三子棋“升级版(模式选择+AI下棋)
Vb how to connect mysql_vb how to connect to the database collection "advice"
多主复制下处理写冲突(4)-多主复制拓扑
AVH部署实践 (一) | 在Arm虚拟硬件上部署飞桨模型
多主复制的适用场景(2)-需离线操作的客户端和协作编辑
Gorm—Go language database framework
Ubantu专题4:xshell、xftp连接接虚拟机以及设置xshell复制粘贴快捷键
Linux查看redis版本(查看mongodb版本)
Browser's built-in color picker
【MySQL】Mysql范式及外键作用
数据库的范式(第一范式,第二范式,第三范式,BCNF范式)「建议收藏」
Matlab矩阵基本操作(定义,运算)
R language ggplot2 visualization: use the ggboxplot function of the ggpubr package to visualize the box plot, use the font function to customize the font size, color, style (bold, italic) of the legen
工程水文学复习资料
MySQL数据库操作
Visualize GraphQL schemas with GraphiQL