当前位置:网站首页>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.
边栏推荐
- 工程水文学试卷
- thread_local 变量的析构顺序
- Codeforces Round #796 (Div. 2)(A-D)
- Ubantu project 4: xshell, XFTP connected the virtual machine and set xshell copy and paste the shortcut
- Delete table data or clear table
- 01 Encounter typescript, build environment
- leetcode303 Weekly Match Replay
- border控件的使用
- R语言ggplot2可视化:使用ggpubr包的ggboxplot函数可视化分组箱图、使用ggpar函数改变图形化参数(legend、修改可视化图像的图例在整图中的位置)
- Delete the disk in good condition (recovery partition)
猜你喜欢
Use of radiobutton
「秋招系列」MySQL面试核心25问(附答案)
Why is the field of hacking almost filled with boys?
Getting Started with TextBlock Control Basic Tools Usage, Get Started
Why don't you make a confession during the graduation season?
Ubantu project 4: xshell, XFTP connected the virtual machine and set xshell copy and paste the shortcut
工程水文学复习资料
radiobutton的使用
WPF project - basic usage of controls entry, you must know XAML
leetcode303 Weekly Match Replay
随机推荐
Deployment应用生命周期与Pod健康检查
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
全新宝马3系上市,安全、舒适一个不落
Matlab矩阵基本操作(定义,运算)
7、常见面试口语提问问题汇总
第二届中国PWA开发者日
多主复制的适用场景(2)-需离线操作的客户端和协作编辑
Ubantu专题4:xshell、xftp连接接虚拟机以及设置xshell复制粘贴快捷键
Excel quickly aligns the middle name of the table (two-word name and three-word name alignment)
Kubernetes原理剖析与实战应用手册,太全了
R语言ggplot2可视化:使用ggpubr包的ggboxplot函数可视化箱图、使用font函数自定义图例标题文本(legend.title)字体的大小、颜色、样式(粗体、斜体)
R语言检验样本是否符合正态性(检验样本是否来自一个正态分布总体):shapiro.test函数检验样本是否符合正态分布(normality test)
R语言向前或者向后移动时间序列数据(自定义滞后或者超前的期数):使用dplyr包中的lag函数将时间序列数据向前移动一天(设置参数n为正值)
为什么黑客领域几乎一片男生?
工程水文学名词解释总结
最小费用最大流问题详解
Implement anti-shake and throttling functions
QGIS 加载WMS数据,重新投影
[CUDA study notes] First acquaintance with CUDA
thread_local 变量的析构顺序