# Redis

### Redis 全景图

![](https://1617012602-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M5PFXCiDtVclypn0iMK%2F-MHFN6H6GEN67lBzTABq%2F-MHJFSitC4IwlULWRcuY%2Fimage.png?alt=media\&token=63ca6460-5aef-4d32-a049-f168d561ffd5)

学习 Redis 要从整体上有个宏观的理解，知道 Redis 都包含哪些东西，有哪些部分组成，出问题时可能是哪部分影响的等

从系统维度理解，Redis 有很多知识需要掌握，比如 epoll 网络模型、run-to-complete 模型、简洁高效的线程模型等。

从应用维度上，场景驱动和案例驱动能更好的理解和掌握 Redis，如缓存和集群应用是 Redis 的两大广泛应用，每个应用背后都有一连串问题。

![](https://1617012602-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M5PFXCiDtVclypn0iMK%2F-MHFN6H6GEN67lBzTABq%2F-MHJKkb221e59_yaBieq%2Fimage.png?alt=media\&token=73a3e55f-71e2-4e9e-b9bb-1d0006dc0226)

根据这张全局的图，在遇到问题时就可以按图索骥进行分析，问题 -> 主线 -> 技术点，可以继续丰富这张图。

### Todos

* [ ] [Redis 的 epoll 模型](https://xie.infoq.cn/article/628ae27da9ccb37d2900e8ef4)
* [ ] [Redis6 的多线程](https://xie.infoq.cn/article/91ab6a27e9bca957cab2d1819)
* [ ] [美团针对 Redis Rehash 机制的探索和实践](https://www.cnblogs.com/meituantech/p/9376472.html)
* [ ] [Redis6 的多线程IO处理过程详解](https://zhuanlan.zhihu.com/p/144805500)
* [ ] [微博9年Redis优化之路](https://www.infoq.cn/article/bpdipUY0QM4ilMZbjbS1)
* [ ] 缓存究竟如何运作，才能接住百亿级明星热点的访问？<https://zhuanlan.zhihu.com/p/76394074>
* [ ] <https://xie.infoq.cn/article/ffd54759343fe15a54493adab>
* [ ] <https://xie.infoq.cn/article/ee8b2cd973e8ccd0ef239e944>

### Redis Resource

#### 环境

* <http://redis.cn/>
* [Redis Cluster 搭建流程](https://github.com/shniu/cloud-native-infrastructure/tree/master/middleware/redis-cluster)
* [Redis Cluster on Kubernetes 构建](https://github.com/shniu/cloud-native-infrastructure/tree/master/minikube-dev-env/resources/redis-cluster)
* [Redis 集群规范](http://redis.cn/topics/cluster-spec.html)

#### Command

* [Redis 命令备忘录](https://cheatography.com/tasjaevan/cheat-sheets/redis/)

#### In Action

* [数据库攻略](https://time.geekbang.org/column/article/10301)
* [How Twitter Uses Redis To Scale - 105TB RAM, 39MM QPS, 10,000+ Instances ](http://highscalability.com/blog/2014/9/8/how-twitter-uses-redis-to-scale-105tb-ram-39mm-qps-10000-ins.html)
* [Awesome redis](https://github.com/JamzyWang/awesome-redis)

#### 博客和专栏

* [Redis: under the hood](https://www.pauladamsmith.com/articles/redis-under-the-hood.html#redis-under-the-hood)
* [Redis 核心技术与实践](https://time.geekbang.org/column/article/268247)
* [Redis 深度历险](https://juejin.cn/book/6844733724618129422/section/6844733724660072461)

#### 源码阅读

* <https://github.com/shniu/redis/tree/5.0> by myself, 调试、验证等，一些自己验证某些问题写的 C 代码
* [redis - test features](https://github.com/shniu/redis/tree/5.0/test_features)  自己写的代码来验证一些特性
* [Redis 源码分析](http://bbs.redis.cn/forum.php?mod=viewthread\&tid=545)
* [oss-study/redis](https://github.com/oss-study/redis)
* [Redis 数据结构与实现](https://wingsxdu.com/post/database/redis/struct/#gsc.tab=0) - beihai blog

#### 案例

* [Redis 响应变慢，如何解决](https://time.geekbang.org/column/article/78984)
* [用 Redis 构建集群的最佳实践](https://time.geekbang.org/column/article/217590)
* [缓存的最佳实践系列](https://time.geekbang.org/column/article/149899)
* <https://github.com/JamzyWang/awesome-redis#use-cases>
* <https://github.com/springside/springside4/wiki/redis>&#x20;
* [海量数据和高并发下的 Redis 优化实践](https://juejin.cn/post/6844903873216249863#heading-0)
* [使用云数据库 Redis 的通用最佳实践](https://tech.antfin.com/docs/2/163173) aliyun Redis

#### Book

* [Redis 使用手册](https://weread.qq.com/web/reader/75732070719551157574079)
* [Redis 5 设计与源码分析](https://weread.qq.com/web/reader/d36322207190b923d368a9akc81322c012c81e728d9d180)   (WIP)
* [Redis 设计与实现](https://weread.qq.com/web/reader/d35323e0597db0d35bd957bkc81322c012c81e728d9d180)
* [Redis 开发与运维](https://weread.qq.com/web/reader/439327a0811e1aa5dg0166fd)
