文章目录
如何学习Redis
借助极客时间上蒋德钧老师的《Redis核心技术与实战》课程中的两张图来系统学习Redis:
- 学习一门新的技术,需要先建立起一个完整的知识框架,形成系统观,不可以只关注零散的知识点,否则就会出现学了忘,忘了再学的死循环。在解决问题时,拥有了系统观,就意味着你能有依据、有章法地定位和解决问题。
- 在学习的过程中还需要不断地丰富这张问题画像图,这样在遇到一个问题时方可全面地考虑解决方法。
以上这两点同样适用于其他技术的学习。 - 再就是IT学习过程中最终要的是要学会借助官网文档。
官网上的Redis概述
Redis是一个开源的(BSD协议,允许修改代码,无版权争议),基于内存的data structure store,常被用于数据库、缓存和消息代理。支持strings、hashes、lists、sets、用于范围查询的sorted sets;bitmaps、hyperloglogs、geospatial indexes radius queries and streams ;Redis 有内置的 replication, Lua scripting, LRU eviction, transactions[事务] and different levels of on-disk persistence, 提供高可用 via[通过] Redis Sentinel and automatic partitioning with Redis Cluster.
可以进行原子操作,:like appending to a string; incrementing the value in a hash; pushing an element to a list; computing set intersection(交), union(并) and difference(差); or getting the member with highest ranking in a sorted set.
Redis 工作在 an in-memory dataset. 根据自己的用例选择持久化机制: by dumping the dataset to disk every once in a while(RDB), or by appending each command to a log(AOF). Persistence can be optionally disabled[持久性可选择性关闭], 如果你只需要 a feature-rich, networked, in-memory cache.
Redis 也支持 trivial-to-setup master-slave asynchronous replication[主从异步复制], with very fast non-blocking first synchronization, auto-reconnection with partial resynchronization on net split.
其他特性:
- Transactions
- Pub/Sub
- Lua scripting
- Keys with a limited time-to-live
- LRU eviction of keys
- Automatic failover