自学内容网 自学内容网

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

原文地址:https://blog.csdn.net/xxxmmc/article/details/142606118

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!