当前位置:网站首页>为什么要使用Redis
为什么要使用Redis
2022-07-06 09:20:00 【快醒醒鸭今天你编程了吗?】
主要有以下两方面
1、从高并发上来说:
直接操作缓存能够承受的请求是,远远大于直接访问数据库的,所以我们可以考虑把数据库中的部分数据转移到缓存中去,这样用户的一部分请求会直接到缓存这里而不用经过数据库
2、从高性能上来说:
用户第一次访问数据库中的某些数据,因为是从硬盈上读取的所以这个过程会比较慢,将该用户访问的数据存在缓存中,下一次再访问这些数据的时候就可以直接从缓存中获取了,操作缓存就是直接操作内存,所以速度相当快
为什么要使用Redis而不是其他的,例如Java自带的map或者guava?
缓存分为本地缓存和分布式缓存,像map和guava就是本地缓存,本地缓存最主要的特点是轻量以及快速,生命周期随着jivm的销毁而结束,在多实例的情况下,每个实例都需要各自保存一份缓存,缓存不具有一致性
使用redis或memcached之类的称为分布式缓存,在多实例的情况下,各实例共用份缓存为握 缓存具有一致性。
边栏推荐
- Relational algebra of tyut Taiyuan University of technology 2022 database
- TYUT太原理工大学2022数据库考试题型大纲
- TYUT太原理工大学2022软工导论大题汇总
- The latest tank battle 2022 - Notes on the whole development -2
- [中国近代史] 第九章测验
- 抽象类和接口
- Network layer 7 protocol
- MySQL limit x, -1 doesn't work, -1 does not work, and an error is reported
- 4.分支语句和循环语句
- Comparison between FileInputStream and bufferedinputstream
猜你喜欢

5.MSDN的下载和使用

西安电子科技大学22学年上学期《射频电路基础》试题及答案

C language to achieve mine sweeping game (full version)

System design learning (I) design pastebin com (or Bit.ly)

Mortal immortal cultivation pointer-2

View UI plus released version 1.3.0, adding space and $imagepreview components

Alibaba cloud microservices (I) service registry Nacos, rest template and feign client

View UI plus released version 1.2.0 and added image, skeleton and typography components

4.分支语句和循环语句

Pit avoidance Guide: Thirteen characteristics of garbage NFT project
随机推荐
6. Function recursion
MPLS experiment
[中国近代史] 第九章测验
4. Binary search
3.输入和输出函数(printf、scanf、getchar和putchar)
[while your roommate plays games, let's see a problem]
5. Download and use of MSDN
Set container
TYUT太原理工大学2022数据库大题之概念模型设计
Alibaba cloud microservices (IV) service mesh overview and instance istio
【毕业季·进击的技术er】再见了,我的学生时代
西安电子科技大学22学年上学期《信号与系统》试题及答案
Differences and application scenarios between MySQL index clock B-tree, b+tree and hash indexes
Small exercise of library management system
凡人修仙学指针-2
Arduino+ds18b20 temperature sensor (buzzer alarm) +lcd1602 display (IIC drive)
View UI plus released version 1.3.1 to enhance the experience of typescript
4.30 dynamic memory allocation notes
3.C语言用代数余子式计算行列式
13 power map