当前位置:网站首页>Redis' cache penetration, cache breakdown, cache avalanche
Redis' cache penetration, cache breakdown, cache avalanche
2022-07-06 01:01:00 【Middle aged leaning on crutches to learn java】
Prior to redis In the article of , We said redis Master-slave replication of , Now let's talk about redis Frequent concentration problems
1, Cache penetration , It refers to data not in the cache and not in the database , This will result in cache misses , Because there is no such data in the database , So it will not be written to the cache after the request , This will lead to direct access to the data source , Result in crushing the data source
2, Cache breakdown , Refer to key The corresponding data exists , But it expired in the cache . At this time, a large number of highly concurrent data requests come , It will lead to direct access to the data source because there is no cache , After accessing, you need to write the data back to the data source , This will easily overwhelm the data source
3, Cache avalanche , This is when the cache server restarts or the cache fails within a time period , This will invalidate all caches , To crush the data source
Solution
For cache penetration , I know about two ways
The first is to use a large enough bitmap( use bitmap, Because it can save more space ) Put all possible key It's all in it , In this way, non-existent requests will be filtered out
The second is to use a null value storage , After a nonexistent request calls , Not in cache , Will go to the data source to check , At this time, because there is no data source, we will not write back to the cache , But to avoid cache penetration , We can also save this null value , It's just that the expiration time is set shorter .
Cache breakdown is now commonly used in the way of locking , Xiaobian is a little sleepy , I'll share these with you next time .
边栏推荐
- [groovy] JSON serialization (jsonbuilder builder | generates JSON string with root node name | generates JSON string without root node name)
- Obstacle detection
- STM32 key chattering elimination - entry state machine thinking
- 孤勇者
- 如何制作自己的机器人
- 新手入门深度学习 | 3-6:优化器optimizers
- Arduino hexapod robot
- Zhuhai's waste gas treatment scheme was exposed
- FFT 学习笔记(自认为详细)
- Programmer growth Chapter 9: precautions in real projects
猜你喜欢
Beginner redis
图解网络:TCP三次握手背后的原理,为啥两次握手不可以?
VSphere implements virtual machine migration
After Luke zettlemoyer, head of meta AI Seattle research | trillion parameters, will the large model continue to grow?
Illustrated network: the principle behind TCP three-time handshake, why can't two-time handshake?
Starting from 1.5, build a micro Service Framework - call chain tracking traceid
如何制作自己的機器人
MYSQL GROUP_ The concat function realizes the content merging of the same ID
Mobilenet series (5): use pytorch to build mobilenetv3 and learn and train based on migration
ubantu 查看cudnn和cuda的版本
随机推荐
[groovy] XML serialization (use markupbuilder to generate XML data | set XML tag content | set XML tag attributes)
Leetcode Fibonacci sequence
For a deadline, the IT fellow graduated from Tsinghua suddenly died on the toilet
esxi的安装和使用
282. Stone consolidation (interval DP)
Leetcode study - day 35
Natural language processing (NLP) - third party Library (Toolkit):allenlp [library for building various NLP models; based on pytorch]
SAP Spartacus home 页面读取 product 数据的请求的 population 逻辑
How spark gets columns in dataframe --column, $, column, apply
云导DNS和知识科普以及课堂笔记
Live video source code, realize local storage of search history
[day 30] given an integer n, find the sum of its factors
MYSQL---查询成绩为前5名的学生
[groovy] XML serialization (use markupbuilder to generate XML data | create sub tags under tag closures | use markupbuilderhelper to add XML comments)
Exciting, 2022 open atom global open source summit registration is hot
视频直播源码,实现本地存储搜索历史记录
logstash清除sincedb_path上传记录,重传日志数据
Finding the nearest common ancestor of binary search tree by recursion
Model analysis of establishment time and holding time
Cannot resolve symbol error