当前位置:网站首页>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.
边栏推荐
- 多主复制的适用场景(1)-多IDC
- [CUDA study notes] First acquaintance with CUDA
- 763.划分字母区间——之打开新世界
- Delete table data or clear table
- MySQL的相关问题
- Ubantu专题4:xshell、xftp连接接虚拟机以及设置xshell复制粘贴快捷键
- TRACE32 - SNOOPer-based variable logging
- hough变换检测直线原理(opencv霍夫直线检测)
- leetcode303场周赛复盘
- R语言检验样本是否符合正态性(检验样本是否来自一个正态分布总体):shapiro.test函数检验样本是否符合正态分布(normality test)
猜你喜欢
随机推荐
Synchronized and volatile interview brief summary
Delete the disk in good condition (recovery partition)
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】Mysql范式及外键作用
Why don't you make a confession during the graduation season?
【Meetup预告】OpenMLDB+OneFlow:链接特征工程到模型训练,加速机器学习模型开发
R语言检验样本是否符合正态性(检验样本是否来自一个正态分布总体):shapiro.test函数检验样本是否符合正态分布(normality test)
R语言ggplot2可视化:使用ggpubr包的ggboxplot函数可视化箱图、使用font函数自定义图例标题文本(legend.title)字体的大小、颜色、样式(粗体、斜体)
Use of radiobutton
763.划分字母区间——之打开新世界
工程力学复习资料
type of timer
对话庄表伟:开源第一课
网银被盗?这篇文章告诉你如何安全使用网银
多主复制的适用场景(1)-多IDC
Synchronized和volatile 面试简单汇总
Implementing click on the 3D model in RenderTexture in Unity
The normal form of the database (first normal form, second normal form, third normal form, BCNF normal form) "recommended collection"
Getting Started with TextBlock Control Basic Tools Usage, Get Started
json到底是什么(c# json)









