当前位置:网站首页>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 .
边栏推荐
- vSphere实现虚拟机迁移
- Distributed base theory
- Convert binary search tree into cumulative tree (reverse middle order traversal)
- Logstash clear sincedb_ Path upload records and retransmit log data
- STM32按键消抖——入门状态机思维
- Fibonacci number
- The value of applet containers
- Beginner redis
- [groovy] XML serialization (use markupbuilder to generate XML data | create sub tags under tag closures | use markupbuilderhelper to add XML comments)
- 详细页返回列表保留原来滚动条所在位置
猜你喜欢
MobileNet系列(5):使用pytorch搭建MobileNetV3并基于迁移学习训练
What is the most suitable book for programmers to engage in open source?
Free chat robot API
Illustrated network: the principle behind TCP three-time handshake, why can't two-time handshake?
Meta AI西雅图研究负责人Luke Zettlemoyer | 万亿参数后,大模型会持续增长吗?
有谁知道 达梦数据库表的列的数据类型 精度怎么修改呀
Finding the nearest common ancestor of binary tree by recursion
For a deadline, the IT fellow graduated from Tsinghua suddenly died on the toilet
Spark SQL null value, Nan judgment and processing
KDD 2022 | EEG AI helps diagnose epilepsy
随机推荐
ubantu 查看cudnn和cuda的版本
WordPress collection plug-in automatically collects fake original free plug-ins
MCU通过UART实现OTA在线升级流程
[groovy] XML serialization (use markupbuilder to generate XML data | create sub tags under tag closures | use markupbuilderhelper to add XML comments)
Kotlin core programming - algebraic data types and pattern matching (3)
[groovy] compile time metaprogramming (compile time method injection | method injection using buildfromspec, buildfromstring, buildfromcode)
The growth path of test / development programmers, the problem of thinking about the overall situation
FFT 学习笔记(自认为详细)
The third season of ape table school is about to launch, opening a new vision for developers under the wave of going to sea
servlet(1)
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]
Spark DF adds a column
Cannot resolve symbol error
[day 30] given an integer n, find the sum of its factors
BiShe - College Student Association Management System Based on SSM
How spark gets columns in dataframe --column, $, column, apply
Four dimensional matrix, flip (including mirror image), rotation, world coordinates and local coordinates
【文件IO的简单实现】
Questions about database: (5) query the barcode, location and reader number of each book in the inventory table
MYSQL GROUP_ The concat function realizes the content merging of the same ID