当前位置:网站首页>为什么要使用Redis
为什么要使用Redis
2022-07-06 09:20:00 【快醒醒鸭今天你编程了吗?】
主要有以下两方面
1、从高并发上来说:
直接操作缓存能够承受的请求是,远远大于直接访问数据库的,所以我们可以考虑把数据库中的部分数据转移到缓存中去,这样用户的一部分请求会直接到缓存这里而不用经过数据库
2、从高性能上来说:
用户第一次访问数据库中的某些数据,因为是从硬盈上读取的所以这个过程会比较慢,将该用户访问的数据存在缓存中,下一次再访问这些数据的时候就可以直接从缓存中获取了,操作缓存就是直接操作内存,所以速度相当快
为什么要使用Redis而不是其他的,例如Java自带的map或者guava?
缓存分为本地缓存和分布式缓存,像map和guava就是本地缓存,本地缓存最主要的特点是轻量以及快速,生命周期随着jivm的销毁而结束,在多实例的情况下,每个实例都需要各自保存一份缓存,缓存不具有一致性
使用redis或memcached之类的称为分布式缓存,在多实例的情况下,各实例共用份缓存为握 缓存具有一致性。
边栏推荐
- 3. C language uses algebraic cofactor to calculate determinant
- Redis cache obsolescence strategy
- Smart classroom solution and mobile teaching concept description
- arduino+DS18B20温度传感器(蜂鸣器报警)+LCD1602显示(IIC驱动)
- Implement queue with stack
- View UI Plus 发布 1.3.0 版本,新增 Space、$ImagePreview 组件
- arduino+水位传感器+led显示+蜂鸣器报警
- Change vs theme and set background picture
- (super detailed II) detailed visualization of onenet data, how to plot with intercepted data flow
- 用栈实现队列
猜你喜欢

20220211-CTF-MISC-006-pure_ Color (use of stegsolve tool) -007 Aesop_ Secret (AES decryption)

Relational algebra of tyut Taiyuan University of technology 2022 database

Arduino+ds18b20 temperature sensor (buzzer alarm) +lcd1602 display (IIC drive)

(超详细二)onenet数据可视化详解,如何用截取数据流绘图

TYUT太原理工大学2022数据库之关系代数小题

6.函数的递归

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

Caching mechanism of leveldb

Alibaba cloud microservices (II) distributed service configuration center and Nacos usage scenarios and implementation introduction

最新坦克大战2022-全程开发笔记-2
随机推荐
初识指针笔记
5. Download and use of MSDN
1.初识C语言(1)
2.C语言矩阵乘法
1. C language matrix addition and subtraction method
7. Relationship between array, pointer and array
IPv6 experiment
[while your roommate plays games, let's see a problem]
System design learning (III) design Amazon's sales rank by category feature
Application architecture of large live broadcast platform
Interview Essentials: talk about the various implementations of distributed locks!
[中国近代史] 第五章测验
TYUT太原理工大学2022数据库考试题型大纲
Alibaba cloud microservices (I) service registry Nacos, rest template and feign client
MySQL Database Constraints
西安电子科技大学22学年上学期《射频电路基础》试题及答案
(super detailed II) detailed visualization of onenet data, how to plot with intercepted data flow
Arduino+ water level sensor +led display + buzzer alarm
6. Function recursion
3.输入和输出函数(printf、scanf、getchar和putchar)