当前位置:网站首页>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.
边栏推荐
- 【Meetup预告】OpenMLDB+OneFlow:链接特征工程到模型训练,加速机器学习模型开发
- Delete the disk in good condition (recovery partition)
- Unity中实现点选RenderTexture中的3D模型
- 微信聊天记录中搜索红包
- [MySQL] Mysql paradigm and the role of foreign keys
- border控件的使用
- 数据表插入数据insert into
- MySQL database operations
- 6-22漏洞利用-postgresql数据库密码破解
- Linux check redis version (check mongodb version)
猜你喜欢
leetcode303场周赛复盘
The use of button controls
Internet banking stolen?This article tells you how to use online banking safely
Ubantu专题5:设置静态ip地址
工程流体力学复习
国内市场上的BI软件,到底有啥区别
What is the difference between BI software in the domestic market?
Female service community product design
How useful is four-quadrant time management?
腾讯云部署----DevOps
随机推荐
thread_local 变量的析构顺序
Vb how to connect mysql_vb how to connect to the database collection "advice"
Kubernetes常用命令
【MySQL】Mysql范式及外键作用
Matlab matrix basic operations (definition, operation)
org.apache.jasperException(could not initialize class org)
Qt实战案例(54)——利用QPixmap设计图片透明度
Implement anti-shake and throttling functions
01 Encounter typescript, build environment
org.apache.jasperException(could not initialize class org)
11 pinia use
网银被盗?这篇文章告诉你如何安全使用网银
贪吃蛇项目(简单)
Deployment application life cycle and Pod health check
Use of radiobutton
The use of border controls
what exactly is json (c# json)
t-sne 数据可视化网络中的部分参数+
ES6 类
radiobutton的使用