Redis deep dive

总领

好处:

  1. 简单高效的cache in-memory + single thread,主要就是快
    O(100k)的写入+微妙级别的读
  2. 在pub/sub的设置中便宜
    trade off:
  3. not get the same garentee as DB for minimizing DB loss
  4. 在pub/sub中消息顺序不保证并且消息丢失也没有很好的机制

有哪些数据结构支持

Strings
Hashes (Objects)
Lists
Sets
Sorted Sets (Priority Queues)
Bloom Filters
Geospatial Indexes
Time Series

如何scale up

sharding by key

系统设计中我在什么时候会需要用到这个组件

  1. Cache - TTL 是多少
  2. Distributed lock when we acquire the lock we run INCR, if the response is 1 那就行,如果response > 1说明某个id被锁住了
  3. Redis可以用来做leaderboard,sorted list能很快得到最上面的值
  4. Redis rate limiting
  5. Reids GEOHASH
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值