redis hash 存每个用户个性化列表行吗?
source link: https://www.v2ex.com/t/813391
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.
现在项目,有个题目列表,每个题目会根据用户的身高体重年龄有不同文字介绍。
我现在是存 redis hash ,userid=>题目列表 json (加起来 200 字不到),用户登录直接用 userid 取。
用户用到才存入 hash ,30 天过期时间。
用户越多,hash 会越来越大,几十万后 redis 性能压力大吗?
优化的话,想拆分 hash ,一个 hash 存不同题目列表,一个 hash 存用户及上个 hash 关联 id ,这样可以省点空间。
或者不做缓存,其实也就 3 条 sql 。
Recommend
-
9
我们在缓存json数据到redis时经常会面临是选择string类型还是选择hash类型去存储。接下来我从占用空间和IO两方面来分析这两种类型的优势。 1、占用空间 根据数据结构的共识我们知道hashtable类型是要比string类型更占...
-
10
空中楼阁之纸上谈兵 redis中hash的思考文章>空中楼阁之纸上谈兵 redis中hash的思考空中楼阁之纸上谈兵 redis中hash的思考
-
8
哈希表的优势 哈希表作为一种关键的数据结构应用非常普遍,比如在 Memcache 中,哈希表被用来作索引。而对于 Redis 来说,哈希表是键值对中的一种值类型,同时,Redis 也是用一个全局哈希表来保存所有的键值对,这样既能满足应用存取哈希型结构的数据...
-
4
带你掌握Redis数据类型:string和Hash 原创 华为云开发者社区 2022-03-04 11:34:25...
-
3
<?xml encoding="utf-8" ??>Introduction A Redis hash map is a data type that stores key-pair values as an associative array. By using Redis hash tables, you can benefit from fast lookups and flex...
-
9
透过Redis源码探究Hash表的实现 Posted on 2022年4月17日2022年4月17日 by luozhiyun 转载请声明出处哦~,本篇文章发布于...
-
5
hash的对象编码hash数据类型的对象编码有两种,分别是OBJ_ENCODING_ZIPLIST和OBJ_ENCODING_HT,即一种是以压缩数组;一种是哈希字典。两者的数据格式见下图:
-
2
分类: redis 标签: redis 转载请...
-
4
Redis 哈希Hash底层数据结构 1. Redis 底层数据结构
-
4
Redis常见命令 Redis是典型的key-value数据库: key一般是字符串,而 value包含很多不同的数据类型:
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK