当前位置:网站首页>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 principle analysis and practical application manual, too complete
- How useful is four-quadrant time management?
- Matlab矩阵基本操作(定义,运算)
- button控件的使用
- Linux check redis version (check mongodb version)
- 使用 GraphiQL 可视化 GraphQL 架构
- 工程水文学复习资料
- mysql black window ~ build database and build table
- 腾讯云部署----DevOps
猜你喜欢
RecyclerView的高效使用第一节
【CUDA学习笔记】初识CUDA
Kubernetes常用命令
AVH Deployment Practice (1) | Deploying the Flying Paddle Model on Arm Virtual Hardware
Internet banking stolen?This article tells you how to use online banking safely
基于ABP实现DDD
Word表格转到Excel中
How useful is four-quadrant time management?
Efficient use of RecyclerView Section 1
button控件的使用
随机推荐
Kubernetes common commands
自动化测试如何创造业务价值?
基于ABP实现DDD
多主复制的适用场景(1)-多IDC
RecyclerView的高效使用第一节
Implementing click on the 3D model in RenderTexture in Unity
Linux查看redis版本(查看mongodb版本)
TRACE32 - Common Operations
R语言ggplot2可视化:使用ggpubr包的ggmaplot函数可视化MA图(MA-plot)、font.legend参数和font.main参数设置标题和图例字体加粗
763.划分字母区间——之打开新世界
「秋招系列」MySQL面试核心25问(附答案)
Gorm—Go语言数据库框架
ES6 类
JVM参数解析 Xmx、Xms、Xmn、NewRatio、SurvivorRatio、PermSize、PrintGC「建议收藏」
删除 状态良好(恢复分区)的磁盘
R语言ggplot2可视化:使用ggpubr包的ggboxplot函数可视化箱图、使用font函数自定义图例标题文本(legend.title)字体的大小、颜色、样式(粗体、斜体)
苹果官网样式调整 结账时产品图片“巨大化”
what exactly is json (c# json)
leetcode303 Weekly Match Replay
MySQL数据库操作