Redis 8大数据结构
1、String
存储整数和字符串,不推荐使用,浪费内存,每次存储都要装箱操作,底层数据结构为数组,两种数据编码格式,具体内容如下图

2、哈希表(hashes)
在Reids底层哈希表有两种存储方式,ZipList(数组)和HashTable,如果Field的个数超过512个或者Field 中任意一个key或者value的值长度大于64字节会使用HashTable,如下图

3、Set
Set底层数据存储两种存储方式,intzset 和hashtable,如果存在不是数字的值或者数组的长度超过512,数据结构会使用后者,如下图

4、ZSet
ZSet底层也是两种存储方式ZipList和跳跃表,如果长度(length)小于128并且value的长度小于64个字节,会使用ZSet,否则使用后者,图结构如下


5、List
双向链表,数据结构图表如下:

6、BitMaps
7、hyperKloglogs
8、Streams