惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

云风的 BLOG
云风的 BLOG
The GitHub Blog
The GitHub Blog
Y
Y Combinator Blog
博客园 - 三生石上(FineUI控件)
T
The Blog of Author Tim Ferriss
宝玉的分享
宝玉的分享
Hugging Face - Blog
Hugging Face - Blog
WordPress大学
WordPress大学
V
Visual Studio Blog
小众软件
小众软件
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
MongoDB | Blog
MongoDB | Blog
V
V2EX
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 【当耐特】
Microsoft Azure Blog
Microsoft Azure Blog
The Cloudflare Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Engineering at Meta
Engineering at Meta
L
LangChain Blog
Martin Fowler
Martin Fowler
GbyAI
GbyAI
博客园 - 司徒正美

vzard's blog

二叉搜索树的一些性质 - vzard's blog 跳表 - vzard's blog redis的事务 - vzard's blog 二叉树非递归遍历统一写法 - vzard's blog 灵魂七问 - vzard's blog XPath线索追踪技术 - vzard's blog cron表达式小记 - vzard's blog 计算广告核心问题总结 - vzard's blog 实现一个简单的http服务器 - vzard's blog 由三次握手想到的... - vzard's blog Js原型链解读 - vzard's blog 统计知识(1) - vzard's blog 同步Github上的fork - vzard's blog Http协议杂谈 - vzard's blog JAVA虚拟机的类加载机制 - vzard's blog HashMap源码剖析 - vzard's blog Java中的锁 - vzard's blog 关于volatile - vzard's blog 修复hexo博客的一个bug - vzard's blog
redis数据类型及使用场景 - vzard's blog
vzardlloo · 2020-09-08 · via vzard's blog

Redis的数据类型

数据类型对应编码方式

数据类型 编码方式
String rawembstrint
Hash hashtableziplist
List linkedlistziplistquicklist
Set hashtableintset
Zset skiplistziplist

编码类型对应数据结构

编码方式 数据结构
raw 动态字符串编码
embstr 优化内存分配饿字符串分配
int 整数编码
hashtable 散列表编码
ziplist 压缩列表编码
linkedlist 双向链表编码
quicklist 快速列表编码
intset 整数集合编码
skiplist 跳跃表编码

使用场景

数据类型 使用场景
String 普通的k-v缓存,分布式锁
Hash 字典结构,比如缓存一个创意的消耗信息,创意id对应曝光数、点击数等多个subkey
List 关注列表,简单的队列
Set 去重器,集合运算
Zset 排行榜,优先级队列