腾讯云大神呕心沥血整理:redis 深度笔记”,看完全面掌握 redis 核心技术
前言作为这个时代码代码的秃头人员,对 Redis 肯定是不陌生的,如果连 Redis 都没用过,还真不好意思出去面试,指不定被面试官吊打多少次。毕竟现在互联网公司和一些创业公司都要用到 Redis,像亚马逊、谷歌、阿里、腾讯都要使用,可见精通 Redis 使用真的很有必要。所以,今天则分享出腾讯云大神亲自码出的“redis 深度笔记”,笔记内容没有讲一句废话,全篇看下来都是精华!

Ps:由于篇幅限制,笔记无法全部为大家展示出来,就以截图主要内容的形式让大家参考啦,需要完整的朋友可以点击>>传送门<<获取
开篇
1.Redis 可以用来做什么?
由 Redis 面试想到的
Redis 可以做什么?

2.Redis 基础数据结构
Redis 安装
Redis 基础的数据结构
容器型数据结构的通用规则
关于 Redis 使用的一些思考

PART2:Redis 的应用总结 1.分布式锁
分布式锁
超时问题
可重入性

2.延时队列
异步消息队列?
队列空了怎么办?
队列延迟
空闲连接自动断开
锁冲突处理
延时队列的实现
进一步优化

3.位图
基本使用
统计和查找
魔术指令 bitfield

4.HyperLogLog
使用方法
pfadd 这个 pf 是什么意思?
pfmerge 适合什么场合用?
注意事项
HyperLogLog 实现原理
pf 的内存占用为什么是 12k?

5.布隆过滤器
布隆过滤器是什么?
Redis 中的布隆过滤器
布隆过滤器的基本使用
注意事项
布隆过滤器的原理
空间占用估计
实际元素超出时,误判率会怎样变化?
用不上 Redis4.0 怎么办?
布隆过滤器的其他应用

6.简单限流
如何使用 Redis 来实现简单限流策略?

7.漏斗限流
Redis-Cell
一些思考

8.GeoHash
用数据库来算附近的人
GeoHash 算法
Redis 的 Geo 指令基本使用

9.Scan
scan 基础使用
字典的结构
scan 遍历顺序
字典扩容
对比扩容缩容前后的遍历顺序
渐进式 rehash
更多的 scan 指令
大 Key 扫描

PART3:Redis 的原理 1.线程 IO 模型
非阻塞 IO
事件轮询(多路复用)
指令队列
响应队列
定时任务

2.通信协议
RESP(Redis Serialization Protocol)
客户端->服务端
服务端->客户端

3.持久化
快照原理
fork(多进程)
AOF 原理
AOF 重写
fsync
运维
Redis4.0 混合持久化

4.管道
Redis 的消息交互
管道压力测试
深入理解管道本质

5.事务
Redis 事务的基本使用
原子性
discard(丢弃)
优化
Watch

6.PubSub
消息多播
PubSub
模式订阅
消息结构
PubSub 缺点

7.小对象压缩
32bit vs 64bit
小对象压缩存储(ziplist)
内存回收机制
内存分配算法

8.主从同步
CAP 原理
最终一致
主从同步
增量同步
快照同步
增加从节点
无盘复制
Wait 指令

PART4:Redis 集群 1.Sentinel
消息丢失
Sentinel 基本使用

2.Codis
Codis 分片原理
不同的 Codis 实例之间槽位关系如何同步?
扩容
自动均衡
Codis 的代价
Codis 的优点
MGET 指令的操作过程
架构变迁
Codis 的尴尬
Codis 的后台管理

3.Cluster
槽位定位算法
跳转
迁移
容错
网络抖动
可能下线(PFAIL-Possibly Fail)与确定下线(Fail)
Cluster 基本使用
槽位迁移感知
集群变更感知

PART5:Redis 拓展
1.Stream
消息 ID
消息内容
增删改查
独立消费
创建消费组
消费
Stream 消息太多怎么办?
消息如果忘记 ACK 会怎样?
PEL 如何避免消息丢失?
Stream 的高可用
分区 Partition

Redis 每秒执行多少次指令?
Redis 连接了多少客户端?
Redisn 内存占用多大?
复制积压缓存区多大?

3.再谈分布式锁
Redlock 算法
Redlock 使用场景

4.过期策略
过期的 key 集合
定时扫描策略
从库的过期策略

5.LRU
LRU 算法
近似 LRU 算法

6.懒惰删除
Redis 为什么要懒惰删除(lazy free)?
flush
异步队列
AOF Sync 也很慢
更多异步删除点

7.优雅地使用 Jedis
重试

8.保护 Redis
指令安全
端口安全
Lua 脚本安全
SSL 代理

9.Redis 安全通信
spiped 原理
spiped 使用入门

PART6:源码 1.探索字符串内部结构
embstr vs raw
扩容策略

2.探索字典内部
dict 内部结构
渐进式 rehash
查找过程
hash 函数
hash 攻击
扩容条件
缩容条件
set 的结构

3.探索压缩列表内部
增加元素
级联更新
IntSet 小整数集合

4.探索快速列表内部
每个 ziplist 存多少元素?
压缩深度

5.探索跳跃列表内部结构
基本结构
查找过程
随机层数
插入过程
删除过程
更新过程
如果 score 值都一样呢?
元素排名是怎么算出来的?

6.探索紧凑列表内部
级联更新
取代 ziplist

7.探索基数树内部
应用
结构
增删节点

Ps:由于篇幅限制,笔记无法全部为大家展示出来,就以截图主要内容的形式让大家参考啦,需要完整的朋友可以点击>>传送门<<获取
总结
最后,我想说的是,学习并非难事,而贵在坚持,尤其是在我们参与工作之后,要继续坚持学习就更不容易了。但对于程序员来说,学习是立业之根本,如若放弃学习,被市场淘汰是迟早的事情。所以,学习更多新的知识对于自己来说才是一种更大的投资。以上,到此结束。
评论