当前位置:网站首页>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.
边栏推荐
- Doing things software development - the importance of law and understanding of reasonable conclusions
- Qt实战案例(54)——利用QPixmap设计图片透明度
- TRACE32——常用操作
- Bilateral filtering acceleration "recommended collection"
- 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
- 女性服务社群产品设计
- Delete the disk in good condition (recovery partition)
- ES6 类
- Oracle动态注册非1521端口
- WPF项目--控件入门基础用法,必知必会XAML
猜你喜欢
随机推荐
工程水文学试卷
BGP综合实验(建立对等体、路由反射器、联邦、路由宣告及聚合)
11 pinia使用
ML.NET相关资源整理
After Grafana is installed, the web opens and reports an error
使用 GraphiQL 可视化 GraphQL 架构
长得很怪的箱图
删除表格数据或清空表格
Snake Project (Simple)
The use of border controls
DBeaver连接MySQL 8.x时Public Key Retrieval is not allowed 错误解决
工程流体力学复习
工程力学复习资料
Efficient use of RecyclerView Section 3
update data table update
网银被盗?这篇文章告诉你如何安全使用网银
Deployment application life cycle and Pod health check
Doing things software development - the importance of law and understanding of reasonable conclusions
工程水文学复习资料
Delete table data or clear table









