redis业务处理方案
| key |
value |
analysis |
lifecycle |
refresh |
redis style |
data style |
| K1:k2:$k3 |
demo |
模块:init |
static |
sync |
Value |
json |
|
|
|
|
|
|
|
|
| key |
掌控储存在Redis中的所有键 用冒号分割,包换业务信息 优先使用批量处理mset、mget、hmset、hmget 百万级,优化key的长度,避免产生大量的内存碎片 |
| value |
限制10Kb 高于1Kb建议压缩 |
| analysis |
init(初始化)、update(更新)、scheduled(定时)、cache(缓存)、get(获取)、delete(删除) cache:使用aop来实现 get:注意默认值 scheduled:每晚、周末、月末的周末、节假日等 |
| lifecycle |
静态数据:数字字典;永久或长期有效;数据量有限。 临时数据:限时数据;存活时间明确。 业务数据:使用则缓存生效。
|
| refresh |
sync(同步)、async(异步) |
| redis style |
Value、Map、List、Value-Map… 百万级,考虑Value-Map,get(key) -> hget(group(key),key) |
| data style |
string、json、压缩… |
