当前位置:网站首页>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.
边栏推荐
猜你喜欢

「秋招系列」MySQL面试核心25问(附答案)

6-22漏洞利用-postgresql数据库密码破解

MySQL基础篇【单行函数】

Why is the field of hacking almost filled with boys?

WeChat chat record search in a red envelope
![[MySQL] Mysql paradigm and the role of foreign keys](/img/9d/a4295de26683d7bca2b8e9d14f754b.png)
[MySQL] Mysql paradigm and the role of foreign keys

mysql黑窗口~建库建表

使用 GraphiQL 可视化 GraphQL 架构

BGP综合实验(建立对等体、路由反射器、联邦、路由宣告及聚合)
![[CUDA study notes] First acquaintance with CUDA](/img/a2/f322ebe9dc483028f68882ee2c866b.png)
[CUDA study notes] First acquaintance with CUDA
随机推荐
多主复制的适用场景(1)-多IDC
长得很怪的箱图
ML.NET相关资源整理
R语言ggplot2可视化:使用ggpubr包的ggboxplot函数可视化箱图、使用font函数自定义图例标题文本(legend.title)字体的大小、颜色、样式(粗体、斜体)
435. 无重叠区间
更新数据表update
The normal form of the database (first normal form, second normal form, third normal form, BCNF normal form) "recommended collection"
力扣:56. 合并区间
Word table to Excel
mysql black window ~ build database and build table
border控件的使用
[MySQL] Mysql paradigm and the role of foreign keys
RecyclerView的高效使用第一节
R语言ggplot2可视化:使用ggpubr包的ggboxplot函数可视化分组箱图、使用ggpar函数改变图形化参数(caption、添加、修改可视化图像的题注、脚注内容)
org.apache.jasperException(could not initialize class org)
Ubantu专题4:xshell、xftp连接接虚拟机以及设置xshell复制粘贴快捷键
复制延迟案例(3)-单调读
力扣:738.单调递增的数字
R language test whether the sample conforms to normality (test whether the sample comes from a normally distributed population): shapiro.test function tests whether the sample conforms to the normal d
hough变换检测直线原理(opencv霍夫直线检测)