当前位置:网站首页>Redis/Mysql知识概述
Redis/Mysql知识概述
2022-07-25 08:42:00 【TUJC】
一、数据库


二、Redis
1、Redis 概述
Redis 是完全开源免费的 ,是一个高性能的 key-value 数据库。
参考
2、Redis 速度快原因

3、Redis 数据类型
Redis 支持五种数据类型:string(字符串),hash(哈希),list(列表),set(集合)及 zset sorted set:有序集合)。

4、Redis 的持久化机制
Redis 提供两种持久化机制 RDB 和 AOF 机制:


RDB(Redis DataBase)持久化方式: 是指用数据集快照的方式半持久化模式,记录 redis 数据库的所有键值对,在某个时间点将数据写入一个临时文件,持久化结束后,用这个临时文件替换上次持久化的文件,达到数据恢复。
优点:
(1)只有一个文件 dump.rdb,方便持久化。
(2)容灾性好,一个文件可以保存到安全的磁盘。
(3)性能最大化,fork 子进程来完成写操作,让主进程继续处理命令,所以是 IO 最大化。使用单独子进程来进行持久化,主进程不会进行任何 IO 操作,保证了 redis的高性能.
(4)相对于数据集大时,比 AOF 的启动效率更高。
缺点:
数据安全性低。RDB 是间隔一段时间进行持久化,如果持久化之间 redis 发生故障,会发生数据丢失。所以这种方式更适合数据要求不严谨的时候.
AOF(Append-only file)持久化方式: 是指所有的命令行记录以 redis 命令请 求协议的格式完全持久化存储)保存为 aof 文件。
优点:
1)数据安全,aof 持久化可以配置 appendfsync 属性,有 always,每进行一次命令操作就记录到 aof 文件中一次。
2)通过 append 模式写文件,即使中途服务器宕机,可以通过 redis-check-aof 工具解决数据一致性问题。
3)AOF 机制的 rewrite 模式。AOF 文件没被 rewrite 之前(文件过大时会对命令进行合并重写),可以删除其中的某些命令(比如误操作的 flushall))
缺点:
1)AOF 文件比 RDB 文件大,且恢复速度慢。
2)数据集大的时候,比 rdb 启动效率低。
5、Redis分区

6、Redis缓存


7、Redis 事务
1)事务是一个单独的隔离操作:事务中的所有命令都会序列化、按顺序地执行。
事务在执行的过程中,不会被其他客户端发送来的命令请求所打断。
2)事务是一个原子操作:事务中的命令要么全部被执行,要么全部都不执行。

8、Redis 集群




9 、Redis 是单线程?
10、Redis 淘汰策略


三、Mysql
1、Mysql概述

2、数据库操作
3、表操作

创建表

修改表
4、Mysql函数




5、表数据操作





6、引擎


7、事务

8、数据导入导出

9、经典面试题







边栏推荐
- Wechat reservation applet graduation design of applet completion works (3) background function
- Message Oriented Middleware
- 【黑马程序员】Redis学习笔记004:主从复制+哨兵模式+集群
- TCGA simple download tool V16 installation error
- LabVIEW experiment - temperature detection system (experimental learning version)
- Initial knowledge of WebService (generate jar packages and call methods in remote services)
- YOLOV5环境配置
- Fundamentals of C language
- Graduation project of wechat small program ordering system of small program completion works (6) opening defense ppt
- Hotel room management system based on jsp+servlet+mysql
猜你喜欢

When crontab scheduled task executes jar through script, it encounters a pit where jar package execution is invalid

Idea2021 failed to start. Could not find main class com/intellij/idea/main

A simple hotel background management system based on jsp+servlet+mysql

Foundation 32: page element positioning method XPath --- axis positioning method

Hotel room management system based on jsp+servlet+mysql

提高代码可续性的小技巧,以connectTo方法为例。

LeetCode·83双周赛·6129.全0子数组的数目·数学

FreeMaker模板引擎

为什么要使用MQ消息中间件?这几个问题必须拿下!

Does the server operation and maintenance need to be online 24 hours? Do you need to work overtime on weekends?
随机推荐
@Implementation principle of Autowired annotation
read
Huawei device remote login (Telnet, SSH) configuration
Mongodb database
Foundation 32: page element positioning method XPath --- axis positioning method
C#入门系列(三十) -- 异常处理
Wechat Reservation Reservation of applet completion works applet graduation project (8) graduation project thesis template
Keep your Eyes on the Lane: Real-time Attention-guided Lane Detection
@Differences between requestparam, @pathparam, @pathvariable and other annotations (use of some annotations)
Basis 33: XPath acquisition methods of page elements under various browsers
Rstudio shows that it can't connect to the web page, or it has a new website.
YOLOV5环境配置
孙子兵法随感
nuscenes数据集3D MOT demo,端到端的目标检测和跟踪,检测跟踪联合框架
Redis best practices
Does the server operation and maintenance need to be online 24 hours? Do you need to work overtime on weekends?
Swift初始化器及可选链
Unity HTC vive use
Initial knowledge of WebService (generate jar packages and call methods in remote services)
Ensembles in RNA counts data in TCGA_ ID to gene_ Method of ID

