redis|redis笔记

1.String

Set get getset exists append strlen incr decr incrby decrby getrange setrange setex ttl setnx mset mget msetnx

【redis|redis笔记】2.List
lpush rpush lrange lpop rpop lindex llen lrem ltrim rpoplpush lset linsert

3.Set
sadd smembers sismember scard srem srandmember spop smove Sdiff sinter sunion

4.Hash
hset hget hmset hmget hgetall hdel hlen hexists hkeys hvals hincrby hsetnx

5.Zset
zadd zrange zrem zcard zcount zrangebyscore zrevrange

6.Geospatial
geoadd geopos geodist geohash georadius georadiusbymember

7.Hyperloglog
pfadd pfmerge pfcount

8.Bitmap
setbit getbit bitcount

9.事务
multi discard exec

10.乐观锁
watch unwatch

11.Spring整合
redis.clients jedis 3.2.0 Jedis jedis = new Jedis("127.0.0.1", 6379)

12.Springboot整合
org.springframework.boot spring-boot-starter-data-redis RedisTemplate

13.持久化
rdb (Redis DataBase) aof (Append only File)

14.发布订阅
SUBSCRIBE PUBLISH

15.主从复制
SLAVEOF host port SLAVEOF no one INFO replication

16.哨兵模式
#sentinel.conf sentinel monitor redis 127.0.0.1 6370 1 #启动哨兵 redis-sentinel sentinel.conf

17.高可用问题
缓存穿透:布隆过滤器 缓存空对象
缓存击穿:热点数据永不过期 互斥锁
缓存雪崩:redis高可用 限流降级 数据预热
18.MISCONF Redis is configured to save RDB snapshots
config set stop-writes-on-bgsave-error no

狂神Redis视频地址 https://www.bilibili.com/video/BV1S54y1R7SB

    推荐阅读