String
- 单值缓存
set key value
get key
- 对象缓存
set user:{id}:name liuyiwen
set user:{id}:balance 6666
mset user:1:name liuyiwen user:1:balance 6666
mget user:1:name user:1:balance
- 分布式锁
setnx实现分布式锁(还记得上次分享的时候怎么实现的吗?)
- 计数
INCR articl:readcount:{文章id}
2023-07-24 20:28:34
set key value
get key
set user:{id}:name liuyiwen
set user:{id}:balance 6666
mset user:1:name liuyiwen user:1:balance 6666
mget user:1:name user:1:balance
setnx实现分布式锁(还记得上次分享的时候怎么实现的吗?)
INCR articl:readcount:{文章id}
下一篇:C++基础知识篇:C++ 数组