当前位置:网站首页>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 .
边栏推荐
- 视频直播源码,实现本地存储搜索历史记录
- Pbootcms plug-in automatically collects fake original free plug-ins
- 有谁知道 达梦数据库表的列的数据类型 精度怎么修改呀
- 如何制作自己的機器人
- Building core knowledge points
- Introduction to robotics I. spatial transformation (1) posture, transformation
- The inconsistency between the versions of dynamic library and static library will lead to bugs
- [groovy] compile time meta programming (AST syntax tree conversion with annotations | define annotations and use groovyasttransformationclass to indicate ast conversion interface | ast conversion inte
- STM32按键消抖——入门状态机思维
- [groovy] XML serialization (use markupbuilder to generate XML data | create sub tags under tag closures | use markupbuilderhelper to add XML comments)
猜你喜欢
KDD 2022 | EEG AI helps diagnose epilepsy
2020.2.13
有谁知道 达梦数据库表的列的数据类型 精度怎么修改呀
Differences between standard library functions and operators
Idea remotely submits spark tasks to the yarn cluster
[groovy] compile time metaprogramming (compile time method injection | method injection using buildfromspec, buildfromstring, buildfromcode)
Meta AI西雅图研究负责人Luke Zettlemoyer | 万亿参数后,大模型会持续增长吗?
Free chat robot API
Pbootcms plug-in automatically collects fake original free plug-ins
BiShe - College Student Association Management System Based on SSM
随机推荐
Spark DF adds a column
Mysql--- query the top 5 students
[groovy] compile time metaprogramming (compile time method interception | find the method to be intercepted in the myasttransformation visit method)
Ubantu check cudnn and CUDA versions
Comment faire votre propre robot
NLP basic task word segmentation third party Library: ICTCLAS [the third party library with the highest accuracy of Chinese word segmentation] [Chinese Academy of Sciences] [charge]
A preliminary study of geojson
Beginner redis
可恢复保险丝特性测试
[groovy] JSON serialization (jsonbuilder builder | generates JSON string with root node name | generates JSON string without root node name)
Logstash clear sincedb_ Path upload records and retransmit log data
[day 30] given an integer n, find the sum of its factors
FFT 学习笔记(自认为详细)
Zhuhai laboratory ventilation system construction and installation instructions
MobileNet系列(5):使用pytorch搭建MobileNetV3并基于迁移学习训练
图解网络:TCP三次握手背后的原理,为啥两次握手不可以?
《强化学习周刊》第52期:Depth-CUPRL、DistSPECTRL & Double Deep Q-Network
After 95, the CV engineer posted the payroll and made up this. It's really fragrant
Hundreds of lines of code to implement a JSON parser
Cloud guide DNS, knowledge popularization and classroom notes