当前位置:网站首页>为什么要使用Redis
为什么要使用Redis
2022-07-06 09:20:00 【快醒醒鸭今天你编程了吗?】
主要有以下两方面
1、从高并发上来说:
直接操作缓存能够承受的请求是,远远大于直接访问数据库的,所以我们可以考虑把数据库中的部分数据转移到缓存中去,这样用户的一部分请求会直接到缓存这里而不用经过数据库
2、从高性能上来说:
用户第一次访问数据库中的某些数据,因为是从硬盈上读取的所以这个过程会比较慢,将该用户访问的数据存在缓存中,下一次再访问这些数据的时候就可以直接从缓存中获取了,操作缓存就是直接操作内存,所以速度相当快
为什么要使用Redis而不是其他的,例如Java自带的map或者guava?
缓存分为本地缓存和分布式缓存,像map和guava就是本地缓存,本地缓存最主要的特点是轻量以及快速,生命周期随着jivm的销毁而结束,在多实例的情况下,每个实例都需要各自保存一份缓存,缓存不具有一致性
使用redis或memcached之类的称为分布式缓存,在多实例的情况下,各实例共用份缓存为握 缓存具有一致性。
边栏推荐
- Network layer 7 protocol
- Comparison between FileInputStream and bufferedinputstream
- 【九阳神功】2018复旦大学应用统计真题+解析
- [中国近代史] 第五章测验
- 西安电子科技大学22学年上学期《射频电路基础》试题及答案
- 1.初识C语言(1)
- E-R graph to relational model of the 2022 database of tyut Taiyuan University of Technology
- One article to get UDP and TCP high-frequency interview questions!
- 六种集合的遍历方式总结(List Set Map Queue Deque Stack)
- String class
猜你喜欢

5.函数递归练习

System design learning (III) design Amazon's sales rank by category feature

最新坦克大战2022-全程开发笔记-2

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

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

更改VS主题及设置背景图片

Differences and application scenarios between MySQL index clock B-tree, b+tree and hash indexes

View UI Plus 发布 1.2.0 版本,新增 Image、Skeleton、Typography组件

13 power map

西安电子科技大学22学年上学期《信号与系统》试题及答案
随机推荐
MPLS experiment
初识C语言(下)
继承和多态(下)
TYUT太原理工大学2022数据库大题之概念模型设计
6.函数的递归
Aurora system model of learning database
4.分支语句和循环语句
Data manipulation language (DML)
6. Function recursion
(超详细二)onenet数据可视化详解,如何用截取数据流绘图
Small exercise of library management system
【毕业季·进击的技术er】再见了,我的学生时代
Pit avoidance Guide: Thirteen characteristics of garbage NFT project
IPv6 experiment
C language to achieve mine sweeping game (full version)
C语言实现扫雷游戏(完整版)
Abstract classes and interfaces
CorelDRAW plug-in -- GMS plug-in development -- Introduction to VBA -- GMS plug-in installation -- Security -- macro Manager -- CDR plug-in (I)
Floating point comparison, CMP, tabulation ideas
六种集合的遍历方式总结(List Set Map Queue Deque Stack)