当前位置:网站首页>Replication Latency Case (1) - Eventual Consistency
Replication Latency Case (1) - Eventual Consistency
2022-07-31 15:33:00 【HUAWEI CLOUD】
Tolerating node failures is only one reason to use replication.Other reasons include:
- Scalability, using multiple nodes to handle more requests
- Low latency, allowing replicas to be geographically closer to users
Master-slave replication requires that all write requests are processed by the master node, and the slave node can only process it.This is a good choice for more read and less write scenarios: create multiple slave nodes, spread read requests to all slave nodes, thereby reducing the load on the master node and allowing read requests to be sent to the nearest replica.
With this scalable structure, only adding more slave nodes can improve the service throughput of read requests.But this is only suitable for asynchronous replication. If you try to replicate to all slave nodes synchronously, a single node failure or network outage will make the entire system unable to write.And the more nodes, the higher the probability of failure, so the fully synchronized configuration is very unreliable.
2.1 Eventual Consistency
If the application happens to be reading from an asynchronous slave node that lags behind the master node, it may see outdated data, causing inconsistencies in the database: since not all writes are reflected in the slave node, ifAt the same time, the same query is issued to the master and slave nodes, and different results may be obtained.This inconsistency is only a temporary state. If you stop writing the DB and wait for a while, the slave node will eventually catch up and be consistent with the master node.Not only NoSQL databases are eventually consistent: asynchronous replica followers in relational databases have the same feature.
The word "final" is intentionally vague, and theoretically, there is no limit to how far a copy can fall behind.In normal operation, the time delay (replication lag) between the completion of write operations on the master node and the slave node may be less than 1s, which usually does not cause much impact in practice.But if the system is operating near its limit or there is a problem with the network, the delay can easily exceed a few seconds or even minutes.
边栏推荐
猜你喜欢

Kubernetes原理剖析与实战应用手册,太全了

WeChat chat record search in a red envelope

TRACE32——常用操作

RecyclerView的高效使用第一节

对话庄表伟:开源第一课
![[MySQL] Mysql paradigm and the role of foreign keys](/img/9d/a4295de26683d7bca2b8e9d14f754b.png)
[MySQL] Mysql paradigm and the role of foreign keys

网银被盗?这篇文章告诉你如何安全使用网银

Browser's built-in color picker

Ubantu project 4: xshell, XFTP connected the virtual machine and set xshell copy and paste the shortcut

mysql black window ~ build database and build table
随机推荐
Kubernetes常用命令
Oracle dynamically registers non-1521 ports
Linux查看redis版本(查看mongodb版本)
TRACE32 - Common Operations
工程水文学试卷
腾讯云部署----DevOps
Ubantu专题5:设置静态ip地址
Ubantu专题4:xshell、xftp连接接虚拟机以及设置xshell复制粘贴快捷键
Matlab matrix basic operations (definition, operation)
WPF project - basic usage of controls entry, you must know XAML
多主复制的适用场景(1)-多IDC
女性服务社群产品设计
R语言ggplot2可视化:使用ggpubr包的ggboxplot函数可视化分组箱图、使用ggpar函数改变图形化参数(caption、添加、修改可视化图像的题注、脚注内容)
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
数据表插入数据insert into
双边滤波加速「建议收藏」
Internet banking stolen?This article tells you how to use online banking safely
Word表格转到Excel中
【CUDA学习笔记】初识CUDA
RecyclerView高效使用第三节