一.Redis 缓存数据库二
26.Redis数据安全_AOF持久化机制

27.Redis数据安全_企业中该如何选择持久化机制

28.Redis集群_主从复制概念


29.Redis集群_主从复制搭建
30.Redis集群_主从复制原理剖析


31.Redis集群_哨兵监控概述


32.Redis集群_配置哨兵监控

33.Redis集群_哨兵监控原理剖析


34.Redis集群_哨兵监控故障转移监控


35.Redis集群_Cluster模式概述



36.Redis集群_Cluster模式搭建




37.Redis集群_Cluster模式原理


38.Redis集群_JAVA操作Redis集群

39.Redis企业级解决方案_Redis脑裂


40.Redis企业级解决方案_缓存预热


41.Redis企业级解决方案_缓存穿透


42.Redis企业级解决方案_缓存击穿



43.Redis企业级解决方案_缓存雪崩

44.Redis企业级解决方案_Redis开发规范
value 设计
拒绝 bigkey
防止网卡流量、慢查询, string 类型控制在 10KB 以内, hash 、
list 、 set 、 zset 元素个数不要超过 5000 。
表名 主键 主键值 存储列名字
set user:user_id:1:name baizhan
set user:user_id:1:age 20
查询这个用户
keys user:user_id:9*
162 命令使用
1 、禁用命令
禁止线上使用 keys 、 flushall 、 flushdb 等,通过 redis 的
rename 机制禁掉命令,或者使用 scan 的方式渐进式处理。
2 、合理使用 select
redis 的多数据库较弱,使用数字进行区分,很多客户端支持较
差,同时多业务用多数据库实际还是单线程处理,会有干扰。
3 、使用批量操作提高效率
原生命令:例如 mget 、 mset 。
非原生命令:可以使用 pipeline 提高效率。
注意:
但要注意控制一次批量操作的 元素个数 ( 例如 500 以内,实
际也和元素字节数有关 ) 。
4 、不建议过多使用 Redis 事务功能
Redis 的事务功能较弱 ( 不支持回滚 ) ,而且集群版本 ( 自研和官
方 ) 要求一次事务操作的 key 必须在一个 slot 上。
客户端使用
Jedis : https://github.com/xetorthio/jedis 重点推荐
1
Spring Data redis : https://github.com/spring-projects/spring-data-redis 使用 Spring 框架
时推荐
2
Redisson : https://github.com/mrniko/redisson 分布式锁、阻塞队列的时重点推荐
3
1 、避免多个应用使用一个 Redis 实例
不相干的业务拆分,公共数据做服务化。
2 、使用连接池
可以有效控制连接,同时提高效率,标准使用方式:
163 实时学习反馈
1.Redis 技术中下列符合 key 设计 __ 。
A
user.id
B
user.id.1.age
C
user:id.1.age
D
user:id:1:age
答案
1=>C
执行命令如下:
Jedis jedis = null;
try {
jedis = jedisPool.getResource();
// 具体的命令
jedis.executeCommand()
} catch (Exception e) {
logger.error("op key {} error: " +
e.getMessage(), key, e);
} finally {
// 注意这里不是关闭连接,在 JedisPool 模式下, Jedis 会被
归还给资源池。
if (jedis != null)
jedis.close();
}
45.Redis企业级解决方案_数据一致性

二.Scala分布式语言一
2.1 Scala介绍与安装
1. 课程介绍

2. 什么是Scala

3. 为什么学习Scala

4. 六大特性

5. Scala环境安装

