4

Redis 到底应该怎么存储使用?

 2 years ago
source link: https://www.v2ex.com/t/813275
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

V2EX  ›  Redis

Redis 到底应该怎么存储使用?

  chengouzi · 2 天前 · 4878 次点击

问这个是因为我们公司目前的方法 我觉得挺不妥的 然后我也没有接触过别的公司或者并发比较大的系统中如何存储以及如何读取 redis

使用 redisson 连接的 redis(哨兵)

目前是存人群信息, 分了 1000 个 key (redis 中 key 如果很多的话会有问题么)

1000 个 key 的 value 是 一个大 Map ,存取这个 map 用的是 getLocalCachedMap

map 的每个 key 对应一个人 value 就是他的数据(数据量肯定不大 几百 k 吧)

然后业务集群每天大概请求在 40 -50 亿 然后峰值是 70 亿(其中也会过滤一些请求 比如不合法的或者各种过滤条件过滤掉),剩下的基本每次请求都会去请求一下 Redis 拿用户数据

这样一个 map 的话就会存多个人群数据 这样子维护的话 不会混乱么 比如有的人更新了有的人数据没更新

大家有做过类似的这种 redis 数据维护么 我也想了解了解


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK