当前位置:网站首页>mysql与redis 区别
mysql与redis 区别
2022-07-30 10:14:00 【xmh-sxh-1314】
一、.redis和mysql的区别总结
(1)类型上
从类型上来说,mysql是关系型数据库,redis是缓存数据库
(2)作用上
mysql用于持久化的存储数据到硬盘,功能强大,但是速度较慢
redis用于存储使用较为频繁的数据到缓存中,读取速度快
(3)需求上
mysql和redis因为需求的不同,一般都是配合使用。
二、详细说明
1.mysql和redis的数据库类型
mysql是关系型数据库,主要用于存放持久化数据,将数据存储在硬盘中,读取速度较慢。
redis是NOSQL,即非关系型数据库,也是缓存数据库,即将数据存储在缓存中,缓存的读取速度快,能够大大的提高运行效率,但是保存时间有限
2.mysql的运行机制
mysql作为持久化存储的关系型数据库,相对薄弱的地方在于每次请求访问数据库时,都存在着I/O操作,如果反复频繁的访问数据库。第一:会在反复链接数据库上花费大量时间,从而导致运行效率过慢;第二:反复的访问数据库也会导致数据库的负载过高,那么此时缓存的概念就衍生了出来。
3.缓存
缓存就是数据交换的缓冲区(cache),当浏览器执行请求时,首先会对在缓存中进行查找,如果存在,就获取;否则就访问数据库。
缓存的好处就是读取速度快
4.redis数据库
redis数据库就是一款缓存数据库,用于存储使用频繁的数据,这样减少访问数据库的次数,提高运行效率。
边栏推荐
- 【 HMS core 】 【 Analytics Kit] [FAQ] how to solve the payment amount in huawei pay analysis shows zero problem?
- jmeter接口压力测试(一)
- Do you really understand the 5 basic data structures of Redis?
- 【云原生】-Docker安装部署分布式数据库 OceanBase
- debian10 install djando
- Security tip: FreeType in Qt
- (BUG record) No module named PIL
- Soft Exam System Architect Concise Tutorial | Case Analysis | Requirement Analysis
- Re19:读论文 Paragraph-level Rationale Extraction through Regularization: A case study on European Court
- Mysterious APT Attack
猜你喜欢
![[AGC] Growth Service 2 - In-App Message Example](/img/fa/9190e45c1532aec908a6c68706629a.png)
[AGC] Growth Service 2 - In-App Message Example

Nacos configuration in the project of battle

Meikle Studio - see the actual combat notes of Hongmeng equipment development five - drive subsystem development

Re15:读论文 LEVEN: A Large-Scale Chinese Legal Event Detection Dataset

hcip06 ospf special area comprehensive experiment

易基因:人类tRNA基因位点表现出与衰老相关的DNA高甲基化|研究文章

Multithreading--the usage of threads and thread pools

STM32CubeMX configuration to generate FreeRTOS project

【AGC】增长服务2-应用内消息示例

多线程--线程和线程池的用法
随机推荐
Meikle Studio - see the actual combat notes of Hongmeng equipment development five - drive subsystem development
Verilog之数码管译码
系统设计精选 | 基于FPGA的CAN总线控制器的设计(附代码)
电压跟随器不要随便加
Day113. Shangyitong: WeChat login QR code, login callback interface
Database dirty reads, non-repeatable reads, phantom reads and corresponding isolation levels
(BUG record) No module named PIL
梅科尔工作室-看鸿蒙设备开发实战笔记五——驱动子系统开发
Domino服务器SSL证书安装指南
Unity 锁定相机第二弹
hcip06 ospf special area comprehensive experiment
spark udf accepts and handles null values.
第3章 信息收集
wsl操作
Paper reading: SegFormer: Simple and Efficient Design for Semantic Segmentation with Transformers
(***Key points***) Flink common memory problems and tuning guide (1)
Practical Walkthrough | Calculate Daily Average Date or Time Interval in MySQL
OC - Manual Reference Counting Memory Management
梅科尔工作室-看鸿蒙设备开发实战笔记六—无线联网开发
Js array operating mobile for encapsulation