当前位置:网站首页>为什么要使用Redis
为什么要使用Redis
2022-07-06 09:20:00 【快醒醒鸭今天你编程了吗?】
主要有以下两方面
1、从高并发上来说:
直接操作缓存能够承受的请求是,远远大于直接访问数据库的,所以我们可以考虑把数据库中的部分数据转移到缓存中去,这样用户的一部分请求会直接到缓存这里而不用经过数据库
2、从高性能上来说:
用户第一次访问数据库中的某些数据,因为是从硬盈上读取的所以这个过程会比较慢,将该用户访问的数据存在缓存中,下一次再访问这些数据的时候就可以直接从缓存中获取了,操作缓存就是直接操作内存,所以速度相当快
为什么要使用Redis而不是其他的,例如Java自带的map或者guava?
缓存分为本地缓存和分布式缓存,像map和guava就是本地缓存,本地缓存最主要的特点是轻量以及快速,生命周期随着jivm的销毁而结束,在多实例的情况下,每个实例都需要各自保存一份缓存,缓存不具有一致性
使用redis或memcached之类的称为分布式缓存,在多实例的情况下,各实例共用份缓存为握 缓存具有一致性。
边栏推荐
- MySQL 30000 word essence summary + 100 interview questions, hanging the interviewer is more than enough (Collection Series
- Tyut Taiyuan University of technology 2022 introduction to software engineering summary
- 2-year experience summary, tell you how to do a good job in project management
- [中国近代史] 第五章测验
- Questions and answers of "basic experiment" in the first semester of the 22nd academic year of Xi'an University of Electronic Science and technology
- TYUT太原理工大学往年数据库简述题
- View UI Plus 发布 1.2.0 版本,新增 Image、Skeleton、Typography组件
- IPv6 experiment
- TYUT太原理工大学2022数据库大题之概念模型设计
- arduino+水位传感器+led显示+蜂鸣器报警
猜你喜欢
Relational algebra of tyut Taiyuan University of technology 2022 database
Alibaba cloud microservices (II) distributed service configuration center and Nacos usage scenarios and implementation introduction
1.初识C语言(1)
Questions and answers of "Fundamentals of RF circuits" in the first semester of the 22nd academic year of Xi'an University of Electronic Science and technology
There is always one of the eight computer operations that you can't learn programming
2.C语言初阶练习题(2)
Questions and answers of "basic experiment" in the first semester of the 22nd academic year of Xi'an University of Electronic Science and technology
9. Pointer (upper)
Change vs theme and set background picture
IPv6 experiment
随机推荐
The latest tank battle 2022 full development notes-1
TYUT太原理工大学2022数据库题库选择题总结
Cloud native trend in 2022
Comparison between FileInputStream and bufferedinputstream
7. Relationship between array, pointer and array
Data manipulation language (DML)
Wei Pai: the product is applauded, but why is the sales volume still frustrated
学编程的八大电脑操作,总有一款你不会
Mortal immortal cultivation pointer-1
【九阳神功】2021复旦大学应用统计真题+解析
First acquaintance with C language (Part 2)
凡人修仙学指针-2
Alibaba cloud microservices (II) distributed service configuration center and Nacos usage scenarios and implementation introduction
6. Function recursion
C语言入门指南
六种集合的遍历方式总结(List Set Map Queue Deque Stack)
Summary of multiple choice questions in the 2022 database of tyut Taiyuan University of Technology
3. Number guessing game
Pit avoidance Guide: Thirteen characteristics of garbage NFT project
[中国近代史] 第六章测验