当前位置:网站首页>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.
边栏推荐
- 最小费用最大流问题详解
- The use of border controls
- Delete the disk in good condition (recovery partition)
- Kubernetes principle analysis and practical application manual, too complete
- 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
- ASP.NET Core 产生连续 Guid
- Gorm—Go language database framework
- what exactly is json (c# json)
- mongo enters error
- TRACE32 - C source code association
猜你喜欢
Tencent Cloud Deployment----DevOps
基于ABP实现DDD
mysql black window ~ build database and build table
.NET 20周年专访 - 张善友:.NET 技术是如何赋能并改变世界的
最小费用最大流问题详解
After Grafana is installed, the web opens and reports an error
border控件的使用
【Meetup预告】OpenMLDB+OneFlow:链接特征工程到模型训练,加速机器学习模型开发
TextBlock控件入门基础工具使用用法,取上法入门
QGIS 加载WMS数据,重新投影
随机推荐
力扣:714. 买卖股票的最佳时机含手续费
The use of border controls
Codeforces Round #796 (Div. 2) (A-D)
C language "the third is" upgrade (mode selection + AI chess)
Insert into data table to insert data
ASP.NET Core 产生连续 Guid
Matlab matrix basic operations (definition, operation)
01 Encounter typescript, build environment
R语言向前或者向后移动时间序列数据(自定义滞后或者超前的期数):使用dplyr包中的lag函数将时间序列数据向前移动一天(设置参数n为正值)
After Grafana is installed, the web opens and reports an error
AVH Deployment Practice (1) | Deploying the Flying Paddle Model on Arm Virtual Hardware
自动化测试如何创造业务价值?
How does automated testing create business value?
mysql black window ~ build database and build table
Efficient use of RecyclerView Section 2
SIGABRT 报错时的注意事项和解决方法
Kubernetes common commands
Implement anti-shake and throttling functions
三、数组
更新数据表update