当前位置:网站首页>Replication Latency Case (3) - Monotonic Read
Replication Latency Case (3) - Monotonic Read
2022-07-31 15:33:00 【Huawei cloud】
The second case of the previous asynchronous replication read exception, there is a strange situation where user data is rolled back.
This may be the case if the user reads multiple times from different [slave nodes].Figure-4 shows that user 2345 made the same query twice:
- First query the slave node with low latency
- Then the slave node with the larger delay
This is quite possible if the user refreshes the page and each request is routed to a random server.
The first query returns the most recently added comment by user 1234, but the second query returns nothing because the lagging slave has not pulled the write yet.In effect, the second query observes the system at an earlier point in time than the first query.
- If the first query doesn't return anything, it's not a big problem because user 2345 may not know that user 1234 recently added a comment
- But if user 2345 sees user 1234's comment first, and then sees it disappear, then user 2345 will feel overwhelmed
A monotonic read guarantees that this exception does not occur.This is a weaker guarantee than strong consistency, but stronger than eventual consistency.When reading data, it is possible to see an old value; monotonic reading only means that if a user reads multiple times in sequence, it will not see time backwards, that is, if newer data is previously read, subsequent readsFetch will not get older data.
A solution to implement monotonic reads: ensure that each user always reads from the same replica (different users can read different replicas).Such as selecting replicas based on user ID hashes instead of randomly selecting replicas.But if that replica fails, the user's query will need to be rerouted to another replica.
边栏推荐
- RecyclerView高效使用第三节
- R语言ggplot2可视化:使用ggpubr包的ggboxplot函数可视化分组箱图、使用ggpar函数改变图形化参数(caption、添加、修改可视化图像的题注、脚注内容)
- Emmet 语法
- 女性服务社群产品设计
- button控件的使用
- R语言ggplot2可视化:使用ggpubr包的ggmaplot函数可视化MA图(MA-plot)、font.legend参数和font.main参数设置标题和图例字体加粗
- TextBlock控件入门基础工具使用用法,取上法入门
- .NET 20周年专访 - 张善友:.NET 技术是如何赋能并改变世界的
- border控件的使用
- Getting Started with TextBlock Control Basic Tools Usage, Get Started
猜你喜欢
四象限时间管理有多好用?
WeChat chat record search in a red envelope
Grafana安装后web打开报错
Ubantu专题4:xshell、xftp连接接虚拟机以及设置xshell复制粘贴快捷键
TextBlock控件入门基础工具使用用法,取上法入门
基于ABP实现DDD
Public Key Retrieval is not allowed error solution when DBeaver connects to MySQL 8.x
WPF project - basic usage of controls entry, you must know XAML
Word table to Excel
C language "the third is" upgrade (mode selection + AI chess)
随机推荐
435. 无重叠区间
.NET 20周年专访 - 张善友:.NET 技术是如何赋能并改变世界的
Getting Started with TextBlock Control Basic Tools Usage, Get Started
OPPO在FaaS领域的探索与思考
女性服务社群产品设计
Linux查看redis版本(查看mongodb版本)
TRACE32——C源码关联
第二届中国PWA开发者日
力扣:714. 买卖股票的最佳时机含手续费
复制延迟案例(1)-最终一致性
Kubernetes common commands
Deployment application life cycle and Pod health check
SIGABRT 报错时的注意事项和解决方法
AVH部署实践 (一) | 在Arm虚拟硬件上部署飞桨模型
Kubernetes原理剖析与实战应用手册,太全了
删除表格数据或清空表格
贪吃蛇项目(简单)
button控件的使用
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
Qt实战案例(54)——利用QPixmap设计图片透明度