当前位置:网站首页>Ensure database and cache consistency
Ensure database and cache consistency
2022-06-22 23:08:00 【Bald Xiake】
programme 1: Sync delete
The core processes :
Update the database data first
Then delete the cached data
The problem is :
1) Failed to delete cache. Dirty data exists
2) It is difficult to collapse all update database entries
Modify directly in the database , Cache does not change
programme 2: Delay double delete
The core processes :
Delete cached data
Update database data
Wait for a short time
Delete the cached data again
The problem is :
1) The delay time is difficult to confirm
Whether it's a delay of a second or a few seconds , It's actually hard to confirm , You can't delay for a few minutes , Because if you delay for a few minutes , Then there may be dirty data in these minutes , So it's hard to determine the time .
2) The consistency of data cannot be absolutely guaranteed
programme 3: Asynchronous monitoring binlog Delete + retry
The core processes :
Update the database
monitor binlog Delete cache
Cache deletion fails through MQ Try again and again , Until the deletion is successful
The overall flow chart is as follows :
Refer to how to ensure the consistency of cache and database ( Super detailed case ) Database cache consistency solution
边栏推荐
- 立體渲染
- Considerations for using redisson to operate distributed queues
- ArcGIS应用(二十)Arcgis 栅格图像符号系统提示“This dataset does not have valid histogram required for classificati…”
- What are the indicators, dimensions and models in Business Intelligence BI data warehouse?
- 2021-04-05
- 2021-08-22
- Several ways of redis persistence -- deeply parsing RDB
- 2021-04-14
- Why do you perform performance tests before the software goes online? How to find a software performance testing organization
- In a frame because it set 'X-FRAME-OPTIONS' to' deny '
猜你喜欢

In the middle of the year, we will promote the integration of worry free, and the value-added package will be reduced by 6

Uniapp applet mall develops thinkphp6 points mall, group purchase and seckill packaged app

2021-08-26

In the third week of June, the main growth ranking list (BiliBili platform) of station B single feigua data up was released!

The mental process and understanding of visual project code design

Developing salary management system based on C language course paper + source code and executable EXE file

ArcGIS应用(二十)Arcgis 栅格图像符号系统提示“This dataset does not have valid histogram required for classificati…”

安装typescript环境并开启VSCode自动监视编译ts文件为js文件

5 minutes to quickly launch web applications and APIs (vercel)

The method of making videos of knowledge payment system support m3u8 format playback
随机推荐
Why do you perform performance tests before the software goes online? How to find a software performance testing organization
How much do you know about the cause of amplifier distortion?
From 11 hours to 25 seconds -- is there room for optimization?
volume rendering
2021-03-06
Lua -- iterator, module, meta table
Greedy interval problem (1)
Reinforcement learning weekly (issue 50): saferl kit, gmi-drl, rp-sdrl & offline meta reinforcement learning
2021-05-02
How to manage tasks in note taking software such as flowus and notation?
2020-12-04
A spark app demo
2021-07-27
MySQL multi table operation exercise
The relationship between derivative and differential of function
Half optimized SQL
Next permutation [give play to subjective initiative to discover laws]
Greedy interval problem (2)
Considerations for using redisson to operate distributed queues
Case 2 of SQL performance degradation caused by modifying implicit parameters