当前位置:网站首页>缓存穿透、缓存击穿、缓存雪崩分别是什么
缓存穿透、缓存击穿、缓存雪崩分别是什么
2022-07-04 15:38:00 【51CTO】
缓存中存放的⼤多都是热点数据,⽬的就是防⽌请求可以直接从缓存中获取到数据,⽽不⽤访问 Mysql。
- 缓存雪崩:如果缓存中某⼀时刻⼤批热点数据同时过期,那么就可能导致⼤量请求直接访问Mysql了,解决办法就是在过期时间上增加⼀点随机值,另外如果搭建⼀个⾼可⽤的Redis集群也是防⽌缓 存雪崩的有效⼿段
- 缓存击穿:和缓存雪崩类似,缓存雪崩是⼤批热点数据失效,⽽缓存击穿是指某⼀个热点key突然失效,也导致了⼤量请求直接访问Mysql数据库,这就是缓存击穿,解决⽅案就是考虑这个热点key不 设过期时间
- 缓存穿透:假如某⼀时刻访问redis的⼤量key都在redis中不存在(比如黑客故意伪造⼀些乱七八糟的key),那么也会给数据造成压⼒,这就是缓存穿透,解决⽅案是使⽤布隆过滤器,它的作⽤就是 如果它认为⼀个key不存在,那么这个key就肯定不存在,所以可以在缓存之前加⼀层布隆过滤器来 拦截不存在的key
边栏推荐
猜你喜欢

Chow Tai Fook fulfills the "centenary commitment" and sincerely serves to promote green environmental protection

The test experience "tortured" by the PMP test is worth your review

overflow:auto与felx结合的用法

VMware Tools和open-vm-tools的安装与使用:解决虚拟机不全屏和无法传输文件的问题

【测试开发】软件测试——基础篇

Go micro tutorial - Chapter 2 go micro V3 using gin and etcd

从数数开始

Solution of dealer collaboration system in building materials industry: empowering enterprises to build core competitiveness

MVC模式和三层架构

聊聊异步编程的 7 种实现方式
随机推荐
Understand ThreadLocal in one picture
电子元器件B2B商城系统开发:赋能企业构建进销存标准化流程实例
Visual Studio 2019 (LocalDB)MSSQLLocalDB SQL Server 2014 数据库版本为852无法打开,此服务器支持782
Transformer中position encoding实践
新享科技发布小程序UniPro小优 满足客户移动办公场景
GO开发:如何利用Go单例模式保障流媒体高并发的安全性?
Array filter fliter in JS
leetcode:421. The maximum XOR value of two numbers in the array
Is it safe to open an account online
聊聊异步编程的 7 种实现方式
Visual studio 2019 (localdb) mssqllocaldb SQL Server 2014 database version is 852 and cannot be opened. This server supports 782
Is it safe for CITIC Securities to open an account online? Is the account opening fee charged
表单传递时,如何隐式将值传过去
[Acwing] 58周赛 4489. 最长子序列
开发者,MySQL专栏完更,助你轻松从安装到入门进阶
Learn more about the basic situation of 2022pmp examination
How to choose one plus 10 pro and iPhone 13?
祝贺Artefact首席数据科学家张鹏飞先生荣获 Campaign Asia Tech MVP 2022
PyTorch深度学习快速入门教程
整理混乱的头文件,我用include what you use