当前位置:网站首页>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.
边栏推荐
- Excel快速对齐表格的中姓名(两个字姓名和三个字姓名对齐)
- "Autumn Recruitment Series" MySQL Interview Core 25 Questions (with answers)
- 工程水文学名词解释总结
- ansible学习笔记02
- ASP.NET Core 产生连续 Guid
- What is the difference between BI software in the domestic market?
- AVH Deployment Practice (1) | Deploying the Flying Paddle Model on Arm Virtual Hardware
- Oracle dynamically registers non-1521 ports
- 腾讯云部署----DevOps
- Deployment application life cycle and Pod health check
猜你喜欢
随机推荐
The R language ggstatsplot package ggbarstats function visualizes bar charts, and adds hypothesis test results (including sample number, statistics, effect size and its confidence interval, significan
Kubernetes common commands
01 邂逅typescript,环境搭建
ansible学习笔记02
Kubernetes原理剖析与实战应用手册,太全了
工程流体力学复习
复制延迟案例(1)-最终一致性
数据表插入数据insert into
6-22漏洞利用-postgresql数据库密码破解
border控件的使用
Visualize GraphQL schemas with GraphiQL
what exactly is json (c# json)
数据库的范式(第一范式,第二范式,第三范式,BCNF范式)「建议收藏」
How useful is four-quadrant time management?
7、常见面试口语提问问题汇总
女性服务社群产品设计
DBeaver连接MySQL 8.x时Public Key Retrieval is not allowed 错误解决
435. 无重叠区间
Precautions and solutions when SIGABRT error is reported
The principle of hough transform detection of straight lines (opencv hough straight line detection)