当前位置:网站首页>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.
边栏推荐
- 使用 GraphiQL 可视化 GraphQL 架构
- MySQL database operations
- Use of radiobutton
- Efficient use of RecyclerView Section 2
- R语言ggplot2可视化:使用ggpubr包的ggmaplot函数可视化MA图(MA-plot)、font.legend参数和font.main参数设置标题和图例字体加粗
- R语言计算时间序列数据的移动平均值(滚动平均值、例如5日均线、10日均线等):使用zoo包中的rollmean函数计算k个周期移动平均值
- Ubantu project 4: xshell, XFTP connected the virtual machine and set xshell copy and paste the shortcut
- 复制延迟案例(3)-单调读
- 全新宝马3系上市,安全、舒适一个不落
- Deployment application life cycle and Pod health check
猜你喜欢

Internet banking stolen?This article tells you how to use online banking safely

工程力学复习资料

Excel quickly aligns the middle name of the table (two-word name and three-word name alignment)

Ubantu专题4:xshell、xftp连接接虚拟机以及设置xshell复制粘贴快捷键

工程水文学复习资料

四象限时间管理有多好用?

【CUDA学习笔记】初识CUDA

格林美瑞交所IPO:募资3.8亿美元 更多中国企业将赴欧洲上市

mongo enters error

Public Key Retrieval is not allowed error solution when DBeaver connects to MySQL 8.x
随机推荐
Kubernetes原理剖析与实战应用手册,太全了
The principle of hough transform detection of straight lines (opencv hough straight line detection)
国内市场上的BI软件,到底有啥区别
TRACE32 - SNOOPer-based variable logging
update data table update
RecyclerView的高效使用第一节
435. 无重叠区间
Word表格转到Excel中
R语言ggplot2可视化:使用ggpubr包的ggboxplot函数可视化分组箱图、使用ggpar函数改变图形化参数(legend、修改可视化图像的图例在整图中的位置)
腾讯云部署----DevOps
Synchronized和volatile 面试简单汇总
Ubantu专题5:设置静态ip地址
Efficient use of RecyclerView Section 1
Emmet syntax
R language ggplot2 visualization: use the ggmapplot function of the ggpubr package to visualize the MA plot (MA-plot), the font.legend parameter and the font.main parameter to set the title and legend
7. Summary of common interview questions
Efficient use of RecyclerView Section 2
Why is the field of hacking almost filled with boys?
「秋招系列」MySQL面试核心25问(附答案)
Delete table data or clear table