Redis 的 8 大数据类型,写得非常好!

Stella981
• 阅读 492

点击上方蓝色“程序猿DD”,选择“设为星标”

回复“资源”获取独家整理的学习资料!

Redis 的 8 大数据类型,写得非常好!

来源 | https://blog.itzhouq.cn/redis2

NoSQL 开发中或多或少都会用到,也是面试必问知识点。

最近这几天的面试每一场都问到了,但是感觉回答的并不好,还有很多需要梳理的知识点,这里通过几篇 Redis 笔记整个梳理一遍。关注公众号Java技术栈回复面试也可以刷我整理的系列面试题。

Redis 的八大数据类型

官网可查看命令:http://www.redis.cn/commands.html

Redis-key

127.0.0.1:6379> keys *(empty list or set)127.0.0.1:6379> set name xxxOK127.0.0.1:6379> keys *1) "name"127.0.0.1:6379> set age 1OK127.0.0.1:6379> keys *1) "age"2) "name"127.0.0.1:6379> exists name  # 判断key 是否存在(integer) 1127.0.0.1:6379> exists name1(integer) 0127.0.0.1:6379> move name 1(integer) 1127.0.0.1:6379> keys *1) "age"127.0.0.1:6379> set name yyyOK127.0.0.1:6379> expire name 10  # 设置key的过期时间,单位是秒(integer) 1127.0.0.1:6379> ttl name  # 查看当前key的剩余过期时间(integer) 7127.0.0.1:6379> ttl name(integer) -2127.0.0.1:6379> type age  # 查看当前key的类型string127.0.0.1:6379>

Redis 有以下 8 种数据类型

1、String(字符串)

127.0.0.1:6379> set key1 v1   #设置值OK127.0.0.1:6379> get key1"v1"127.0.0.1:6379> append key1 "hello"  # 追加值,如果不存在,相当于 set key(integer) 7127.0.0.1:6379> get key1"v1hello"127.0.0.1:6379> strlen key1  # 获取字符串长度(integer) 7127.0.0.1:6379>

自增、自减

127.0.0.1:6379> set views 0OK127.0.0.1:6379> get views"0"127.0.0.1:6379> incr views  # 自增 1(integer) 1127.0.0.1:6379> get views"1"127.0.0.1:6379> decr views       # 自减 1(integer) 0127.0.0.1:6379> decr views(integer) -1127.0.0.1:6379> get views"-1"127.0.0.1:6379> incrby views 10  # 设置步长、自增 10 (integer) 9127.0.0.1:6379> decrby views 5      # 设置步长、自减 5(integer) 4

字符串范围

127.0.0.1:6379> set key1 "hello,world!"OK127.0.0.1:6379> get key1"hello,world!"127.0.0.1:6379> getrange key1 0 3  # 截取字符串\[0, 3\]"hell"127.0.0.1:6379> getrange key1 0 -1  # 获取全部的字符串,和 get key一样"hello,world!"127.0.0.1:6379>

替换:

127.0.0.1:6379> set key2 abcdefgOK127.0.0.1:6379> get key2"abcdefg"127.0.0.1:6379> setrange key2 1 xx(integer) 7127.0.0.1:6379> get key2"axxdefg"127.0.0.1:6379>

setex(set with expire):设置过期时间

setnx(set if not exist):不存在再设置(在分布式锁中会经常使用)

127.0.0.1:6379> setex key3 30 "hello"  # 设置 30 秒后过期OK127.0.0.1:6379> ttl key3     # 剩余过期时间(integer) 25127.0.0.1:6379> setnx mykey "redis"   # mykey 不存在时设置成功(integer) 1127.0.0.1:6379> keys *1) "key2"2) "key1"3) "views"4) "mykey"127.0.0.1:6379> setnx mykey "mongoDB"  # mykey 存在时设置失败(integer) 0127.0.0.1:6379> get mykey     # mykey 值不变"redis"127.0.0.1:6379>

mset 和 mget

127.0.0.1:6379> mset k1 v1 k2 v2 k3 v3  # 同时设置多个值OK127.0.0.1:6379> keys *1) "k1"2) "k3"3) "k2"127.0.0.1:6379> mget k1 k2 k3   # 同时获取多个值1) "v1"2) "v2"3) "v3"127.0.0.1:6379> msetnx k1 v1 k4 v4       # msetnx 是一个原子性的操作,要么一起成功,要么都失败(integer) 0127.0.0.1:6379> get k4(nil)127.0.0.1:6379>

对象

set user:1 {name:zhangsan, age:3}     # 设置一个 user:1 对象 值为 json  字符来保存一个对象127.0.0.1:6379> mset user:1:name zhangsan user:1:age 2OK127.0.0.1:6379> mget user:1:name user:1:age1) "zhangsan"2) "2"127.0.0.1:6379>

getset:先 get 再 set

127.0.0.1:6379> getset db redis  # 如果不存在值,则返回 nil(nil)127.0.0.1:6379> get db"redis"127.0.0.1:6379> getset db mongodb  # 如果存在值,获取原来的值,并设置新的值"redis"127.0.0.1:6379> get db"mongodb"127.0.0.1:6379>

String 的使用场景:value 除了是字符串以外还可以是数字

  • 计数器

  • 统计多单位的数量

  • 粉丝数

  • 对象缓存存储

2、List(列表)

基本的数据类型,列表。

在 Redis 中可以把 list 用作栈、队列、阻塞队列。

list 命令多数以 l开头。

127.0.0.1:6379> lpush list one   # 将一个值或者多个值,插入到列表的头部(左)(integer) 1127.0.0.1:6379> lpush list two(integer) 2127.0.0.1:6379> lpush list three (integer) 3127.0.0.1:6379> lrange list 0 -1   # 查看全部元素1) "three"2) "two"3) "one"127.0.0.1:6379> lrange list 0 1    # 通过区间获取值1) "three"2) "two"127.0.0.1:6379> rpush list right   # 将一个值或者多个值,插入到列表的尾部(右)(integer) 4127.0.0.1:6379> lrange list 0 -11) "three"2) "two"3) "one"4) "right"127.0.0.1:6379>

弹出 pop

127.0.0.1:6379> lrange list 0 -11) "!"2) "world"3) "world"4) "hello"127.0.0.1:6379> lpop list  # 移除list的第一个元素"!"127.0.0.1:6379> lrange list 0 -11) "world"2) "world"3) "hello"127.0.0.1:6379> rpop list   # 移除list的第一个元素"hello"127.0.0.1:6379> lrange list 0 -11) "world"2) "world"127.0.0.1:6379>

索引 Lindex

127.0.0.1:6379> lrange list 0 -11) "hjk"2) "world"3) "world"127.0.0.1:6379> lindex list 1  # 通过下标获取list中的某一个值"world"127.0.0.1:6379> lindex list 0"hjk"127.0.0.1:6379>

Llen 长度:

127.0.0.1:6379> llen list(integer) 3127.0.0.1:6379>

移除指定的值:

127.0.0.1:6379> lrange list 0 -11) "hjk"2) "world"3) "world"127.0.0.1:6379> lrem list 1 world  # 移除list集合中指定个数的value,精确匹配(integer) 1127.0.0.1:6379> lrange list 0 -11) "hjk"2) "world"127.0.0.1:6379> lpush list hjk(integer) 3127.0.0.1:6379> lrange list 0 -11) "hjk"2) "hjk"3) "world"127.0.0.1:6379> lrem list 2 hjk(integer) 2127.0.0.1:6379> lrange list 0 -11) "world"127.0.0.1:6379>

trim 截断

127.0.0.1:6379> lrange mylist 0 -11) "hello1"2) "hello2"3) "hello3"4) "hello4"127.0.0.1:6379> ltrim mylist 1 2 # 通过下标截取指定长度,这个list已经被破坏了,截断之后只剩下截断后的元素OK127.0.0.1:6379> lrange mylist 0 -11) "hello2"2) "hello3"127.0.0.1:6379>

rpoplpush :移除列表的最后一个元素,将他移动到新的列表中。

127.0.0.1:6379> lrange mylist 0 -11) "hello1"2) "hello2"3) "hello3"127.0.0.1:6379> rpoplpush mylist myotherlist  # 移除列表的最后一个元素,将他移动到新的列表中。"hello3"127.0.0.1:6379> lrange mylist 0 -1  # 查看原来的列表1) "hello1"2) "hello2"127.0.0.1:6379> lrange myotherlist 0 -1  # 查看目标列表中,确实存在该值1) "hello3"127.0.0.1:6379>

lset:将列表中指定下标的值替换为另一个值,更新操作

127.0.0.1:6379> exists list  # 判断这个列表是否存在(integer) 0127.0.0.1:6379> lset list 0 item  # 如果不存在的话,更新会报错(error) ERR no such key127.0.0.1:6379> lpush list value1(integer) 1127.0.0.1:6379> lrange list 0 0 1) "value1"127.0.0.1:6379> lset list 0 item  # 如果存在,更新当前下标的值OK127.0.0.1:6379> lset list 1 other  # 如果不存在的话,更新会报错(error) ERR index out of range127.0.0.1:6379>

linsert:将某个具体的value插入到列表中某个元素的前面或者后面

127.0.0.1:6379> lrange mylist 0 -11) "hello1"2) "hello2"127.0.0.1:6379> linsert mylist before "hello2" hello(integer) 3127.0.0.1:6379> lrange mylist 0 -11) "hello1"2) "hello"3) "hello2"127.0.0.1:6379> linsert mylist after "hello2" hello(integer) 4127.0.0.1:6379> lrange mylist 0 -11) "hello1"2) "hello"3) "hello2"4) "hello"127.0.0.1:6379>

小结

  • list 实际上是一个链表,前后都可以插入

  • 如果key不存在,创建新的链表

  • 如果移除了所有的值,空链表,也代表不存在

  • 在两边插入或者改动值,效率最高。

3、Set (集合)

127.0.0.1:6379> sadd myset "hello"  # set 集合中添加元素(integer) 1127.0.0.1:6379> sadd myset "world"(integer) 1127.0.0.1:6379> smembers myset      # 查看指定Set的所有值1) "world"2) "hello"127.0.0.1:6379> sismember myset hello  # 判断某一个值是不是在set中(integer) 1127.0.0.1:6379> sismember myset hello1(integer) 0127.0.0.1:6379>

127.0.0.1:6379> scard myset  # 获取集合中的个数(integer) 2127.0.0.1:6379> sadd myset "hello2"(integer) 1127.0.0.1:6379> smembers myset   1) "world"2) "hello2"3) "hello"127.0.0.1:6379> srem myset hello   # 移除元素(integer) 1127.0.0.1:6379> smembers myset1) "world"2) "hello2"127.0.0.1:6379>

127.0.0.1:6379> smembers myset1) "kkk"2) "world"3) "hjk"4) "hello2"127.0.0.1:6379> srandmember myset   # 随机抽取一个元素"hjk"127.0.0.1:6379> srandmember myset"hello2"127.0.0.1:6379> srandmember myset 2   # 随机抽取指定个数的元素1) "world"2) "hello2"127.0.0.1:6379> srandmember myset 21) "hello2"2) "hjk"127.0.0.1:6379>

127.0.0.1:6379> smembers myset1) "kkk"2) "world"3) "hjk"4) "hello2"127.0.0.1:6379> spop myset  # 随机删除元素"hjk"127.0.0.1:6379> smembers myset1) "kkk"2) "world"3) "hello2"127.0.0.1:6379> spop myset"hello2"127.0.0.1:6379> smembers myset1) "kkk"2) "world"127.0.0.1:6379>

127.0.0.1:6379> smembers myset1) "kkk"2) "world"127.0.0.1:6379> sadd myset2 set2(integer) 1127.0.0.1:6379> smove myset myset2 "kkk"   # 将一个特定的值,移动到另一个set集合中(integer) 1127.0.0.1:6379> smembers myset1) "world"127.0.0.1:6379> smembers myset21) "kkk"2) "set2"127.0.0.1:6379>

127.0.0.1:6379> smembers key11) "b"2) "a"3) "c"127.0.0.1:6379> smembers key21) "e"2) "d"3) "c"127.0.0.1:6379> sdiff key1 key2   # 差集1) "b"2) "a"127.0.0.1:6379> sinter key1 key2         # 交集1) "c"127.0.0.1:6379> sunion key1 key2  # 并集1) "e"2) "a"3) "c"4) "d"5) "b"

4、Hash(哈希)

也是 key - value 形式的,但是value 是一个map。

127.0.0.1:6379> hset myhash field xxx  # set 一个 key-value(integer) 1127.0.0.1:6379> hget myhash field   # 获取一个字段值"xxx"127.0.0.1:6379> hmset myhash field1 hello field2 world  # set 多个 key-valueOK127.0.0.1:6379> hmget myhash field field1 field2   # 获取多个字段值1) "xxx"2) "hello"3) "world"127.0.0.1:6379> hgetall myhash    # 获取全部的数据1) "field"2) "xxx"3) "field1"4) "hello"5) "field2"6) "world"

127.0.0.1:6379> hdel myhash field1  # 删除指定的key,对应的value也就没有了(integer) 1127.0.0.1:6379> hgetall myhash1) "field"2) "xxx"3) "field2"4) "world"127.0.0.1:6379>

127.0.0.1:6379> hlen myhash  # 获取长度(integer) 2127.0.0.1:6379> hexists myhash field1   # 判断指定key是否存在(integer) 0127.0.0.1:6379> hexists myhash field2(integer) 1127.0.0.1:6379> hkeys myhash  # 获取所有的key1) "field"2) "field2"127.0.0.1:6379> hvals myhash  # 获取所有的value1) "xxx"2) "world"127.0.0.1:6379>

127.0.0.1:6379> hset myhash field3 5(integer) 1127.0.0.1:6379> hincrby myhash field3 1  # 指定增量(integer) 6127.0.0.1:6379> hincrby myhash field3 -1(integer) 5127.0.0.1:6379> hsetnx myhash field4 hello  # 如果不存在则可以设置(integer) 1127.0.0.1:6379> hsetnx myhash field4 world  # 如果存在则不能设置(integer) 0127.0.0.1:6379>

Hash 适合存储经常变动的对象信息,String 更适合于存储字符串。关注公众号Java技术栈,回复 Redis,可以获取我整理的 Redis 系列教程。

5、zset (有序集合)

127.0.0.1:6379> zadd myset 1 one  # 添加一个值(integer) 1127.0.0.1:6379> zadd myset 2 two 3 three # 添加多个值(integer) 2127.0.0.1:6379> zrange myset 0 -11) "one"2) "two"3) "three"127.0.0.1:6379>

实现排序:

127.0.0.1:6379> zadd salary 2500 xiaohong(integer) 1127.0.0.1:6379> zadd salary 5000 xiaoming(integer) 1127.0.0.1:6379> zadd salary 500 xaiozhang(integer) 1127.0.0.1:6379> zrange salary 0 -11) "xaiozhang"2) "xiaohong"3) "xiaoming"127.0.0.1:6379> zrangebyscore salary -inf +inf  # 从小到大显示全部的用户1) "xaiozhang"2) "xiaohong"3) "xiaoming"127.0.0.1:6379> zrevrange salary 0 -1  # 从大到小进行排序1) "xiaoming"2) "xiaohong"3) "xaiozhang"127.0.0.1:6379> zrangebyscore salary -inf +inf withscores   # 附带成绩的显示所有用户1) "xaiozhang"2) "500"3) "xiaohong"4) "2500"5) "xiaoming"6) "5000"127.0.0.1:6379> zrangebyscore salary -inf 2500 withscores   # 显示工资小于 2500 的用户1) "xaiozhang"2) "500"3) "xiaohong"4) "2500"

127.0.0.1:6379> zrange salary 0 -11) "xaiozhang"2) "xiaohong"3) "xiaoming"127.0.0.1:6379> zrem salary xiaohong  # 移除特定元素(integer) 1127.0.0.1:6379> zrange salary 0 -11) "xaiozhang"2) "xiaoming"127.0.0.1:6379> zcard salary  # 获取有序集合的个数(integer) 2127.0.0.1:6379>

127.0.0.1:6379> zadd myset 1 hello(integer) 1127.0.0.1:6379> zadd myset 2 world 3 !(integer) 2127.0.0.1:6379> zcount myset 1 3  # 获取指定区间的人员数量(integer) 3127.0.0.1:6379> zcount myset 1 2(integer) 2

6、geospatial

Redis 在 3.2 推出 Geo 类型,该功能可以推算出地理位置信息,两地之间的距离。

文档:https://www.redis.net.cn/order/3687.html

借助网站模拟一些数据:http://www.jsons.cn/lngcode/

geoadd 添加地理位置

规则:两极无法直接添加,一般会下载城市数据,直接通过 Java 程序一次性导入。

有效的经度从 -180 度到 180 度。有效的纬度从 -85.05112878 度到 85.05112878 度。当坐标位置超出指定范围时,该命令将会返回一个错误。

(error) ERR invalid longitude latitude pair xxx yyy

添加一些模拟数据:

127.0.0.1:6379> geoadd china:city 116.40 39.90 beijing(integer) 1127.0.0.1:6379> geoadd china:city 121.47 31.23 shanghai(integer) 1127.0.0.1:6379> geoadd china:city 106.50 29.53 chongqing 114.05 22.52 shengzhen(integer) 2127.0.0.1:6379> geoadd china:city 120.16 30.24 hangzhou 108.96 34.26 xian(integer) 2127.0.0.1:6379>

geopos 获得当前定位坐标值

127.0.0.1:6379> geopos china:city beijing  # 获得指定城市的经纬度1) 1) "116.39999896287918091"   2) "39.90000009167092543"127.0.0.1:6379> geopos china:city shanghai1) 1) "121.47000163793563843"   2) "31.22999903975783553"127.0.0.1:6379>

geodist 获取两个位置之间的距离

单位:

  • m 表示单位为米。

  • km 表示单位为千米。

  • mi 表示单位为英里。

  • ft 表示单位为英尺。

如果用户没有显式地指定单位参数, 那么 GEODIST 默认使用米作为单位。

127.0.0.1:6379> geodist china:city beijing shanghai km # 查看北京和上海直接的直线距离"1067.3788"127.0.0.1:6379> geodist china:city beijing chongqing km"1464.0708"127.0.0.1:6379>

georedius 以给定的经纬度为中心,找出某一半径内的元素

127.0.0.1:6379> georadius china:city 110 30 1000 km # 以110, 30 这个点为中心,寻找方圆 1000km 的城市1) "chongqing"2) "xian"3) "shengzhen"4) "hangzhou"127.0.0.1:6379> georadius china:city 110 30 500 km 1) "chongqing"2) "xian"127.0.0.1:6379> georadius china:city 110 30 500 km withcoord #  显示他人的定位信息1) 1) "chongqing"   2) 1) "106.49999767541885376"      2) "29.52999957900659211"2) 1) "xian"   2) 1) "108.96000176668167114"      2) "34.25999964418929977"127.0.0.1:6379> 127.0.0.1:6379> georadius china:city 110 30 500 km withdist #  显示到中心点的距离1) 1) "chongqing"   2) "341.9374"2) 1) "xian"   2) "483.8340"127.0.0.1:6379> georadius china:city 110 30 500 km withdist withcoord count 1  # 指定数量1) 1) "chongqing"   2) "341.9374"   3) 1) "106.49999767541885376"      2) "29.52999957900659211"127.0.0.1:6379> georadius china:city 110 30 500 km withdist withcoord count 21) 1) "chongqing"   2) "341.9374"   3) 1) "106.49999767541885376"      2) "29.52999957900659211"2) 1) "xian"   2) "483.8340"   3) 1) "108.96000176668167114"      2) "34.25999964418929977"127.0.0.1:6379>

GEORADIUSBYMEMBER 找出位于指定元素周围的其他元素

127.0.0.1:6379> georadiusbymember china:city shanghai 1000 km1) "hangzhou"2) "shanghai"127.0.0.1:6379>

geo 底层实现原理其实就是 zset ,可以使用 zset 命令操作 geo

127.0.0.1:6379> zrange china:city 0 -11) "chongqing"2) "xian"3) "shengzhen"4) "hangzhou"5) "shanghai"6) "beijing"127.0.0.1:6379> zrem china:city beijing  # 删除一个元素(integer) 1127.0.0.1:6379> zrange china:city 0 -11) "chongqing"2) "xian"3) "shengzhen"4) "hangzhou"5) "shanghai"127.0.0.1:6379>

7、hyperloglog

基数:数学上集合的元素个数,是不能重复的。

UV(Unique visitor):是指通过互联网访问、浏览这个网页的自然人。访问的一个电脑客户端为一个访客,一天内同一个访客仅被计算一次。

Redis 2.8.9 版本更新了 hyperloglog 数据结构,是基于基数统计的算法。

hyperloglog 的优点是占用内存小,并且是固定的。存储 2^64 个不同元素的基数,只需要 12 KB 的空间。但是也可能有 0.81% 的错误率。

这个数据结构常用于统计网站的 UV。传统的方式是使用 set 保存用户的ID,然后统计 set 中元素的数量作为判断标准。

但是这种方式保存了大量的用户 ID,ID 一般比较长,占空间,还很麻烦。我们的目的是计数,不是保存数据,所以这样做有弊端。但是如果使用 hyperloglog 就比较合适了。

127.0.0.1:6379> pfadd mykey a b c d e f g h i j # 创建第一组元素(integer) 1127.0.0.1:6379> PFCOUNT mykey     # 统计 mykey 基数(integer) 10127.0.0.1:6379> PFADD mykey2 i j z x c v b n m  # 创建第二组元素(integer) 1127.0.0.1:6379> PFCOUNT mykey2     # 统计 mykey2 基数(integer) 9127.0.0.1:6379> PFMERGE mykey3 mykey mykey2  # 合并两组 mykey mykey2 => mykey3OK127.0.0.1:6379> PFCOUNT mykey3(integer) 15127.0.0.1:6379>

8、bitmap 位图

bitmap就是通过最小的单位bit来进行0或者1的设置,表示某个元素对应的值或者状态。一个bit的值,或者是0,或者是1;也就是说一个bit能存储的最多信息是2。

bitmap 常用于统计用户信息比如活跃粉丝和不活跃粉丝、登录和未登录、是否打卡等。

这里使用一周打卡的案例说明其用法:

127.0.0.1:6379> setbit sign 0 1  # 周一打卡了(integer) 0127.0.0.1:6379> setbit sign 1 0  # 周二未打卡(integer) 0127.0.0.1:6379> setbit sign 2 0  # 周三未打卡(integer) 0127.0.0.1:6379> setbit sign 3 1(integer) 0127.0.0.1:6379> setbit sign 4 1(integer) 0127.0.0.1:6379> setbit sign 5 1(integer) 0127.0.0.1:6379> setbit sign 6 0(integer) 0127.0.0.1:6379>

查看某一天是否打卡:

127.0.0.1:6379> GETBIT sign 3(integer) 1127.0.0.1:6379> GETBIT sign 6(integer) 0127.0.0.1:6379>

统计:统计打卡的天数

127.0.0.1:6379> BITCOUNT sign(integer) 4127.0.0.1:6379>

DD自研的沪牌代拍业务,点击直达

【往期推荐】

[

Spring Boot 的2020最后一击:2.4.1、2.3.7、2.2.12 发布

2020-12-13

Redis 的 8 大数据类型,写得非常好!

](https://www.oschina.net/action/GoToLink?url=http%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzAxODcyNjEzNQ%3D%3D%26mid%3D2247514210%26idx%3D1%26sn%3D6c9b7044d364cae5a28fec29e159e455%26chksm%3D9bd315faaca49cec8fc6228dc3a2138824a9562370579b62b929c046977548ed5a49b649f1ea%26scene%3D21%23wechat_redirect)

[

排名前 16 的 Java 工具类,哪个你没用过?

2020-12-13

Redis 的 8 大数据类型,写得非常好!

](https://www.oschina.net/action/GoToLink?url=http%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzAxODcyNjEzNQ%3D%3D%26mid%3D2247514210%26idx%3D2%26sn%3Da55d8a9f8a2ed3e1dc8b837ae258681c%26chksm%3D9bd315faaca49cecdf2931cf0cce57a98a63c94e0f2a1c6557cfbea197dfcf2328480fe5fc55%26scene%3D21%23wechat_redirect)

[

GitHub 推出 2020 宇宙新功能:Dark Mode!从此深夜搞开源不再被亮瞎了!

2020-12-12

Redis 的 8 大数据类型,写得非常好!

](https://www.oschina.net/action/GoToLink?url=http%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzAxODcyNjEzNQ%3D%3D%26mid%3D2247513969%26idx%3D1%26sn%3D28330f2feae78e959eaaa720f4a91e94%26chksm%3D9bd31ae9aca493ff890f70916358d5410f7e45c5c358bdc1695a30e8edcd790940f9e99af001%26scene%3D21%23wechat_redirect)

[

基于 Token 的多平台身份认证架构设计

2020-12-12

Redis 的 8 大数据类型,写得非常好!

](https://www.oschina.net/action/GoToLink?url=http%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzAxODcyNjEzNQ%3D%3D%26mid%3D2247513969%26idx%3D2%26sn%3Dd1a9973000865748136250c218360cbe%26chksm%3D9bd31ae9aca493fff4c6331a349ab2d6b47aaa1ce463671d95778f7509fe65b798fafc0d9a2f%26scene%3D21%23wechat_redirect)

[

Google 鼓励的 13 条代码审查标准,建议收藏!

2020-12-11

Redis 的 8 大数据类型,写得非常好!

](https://www.oschina.net/action/GoToLink?url=http%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzAxODcyNjEzNQ%3D%3D%26mid%3D2247513851%26idx%3D2%26sn%3Da1ad651a6d1f116b9bb785be68a08f72%26chksm%3D9bd31b63aca49275c0b32b8b6b8aa76e8d7266785dd282b2b61b91a6ca9e283235f414d26435%26scene%3D21%23wechat_redirect)

[

据说电脑上可以刷朋友圈啦!又多了个上班摸鱼的途径?

2020-12-11

Redis 的 8 大数据类型,写得非常好!

](https://www.oschina.net/action/GoToLink?url=http%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzAxODcyNjEzNQ%3D%3D%26mid%3D2247513851%26idx%3D3%26sn%3D0cf53aecaf1efa5e712d78e98a3acef5%26chksm%3D9bd31b63aca4927535f656674bd6b74a6da25e2967c10625e48f2e48764e05165a518479c3dd%26scene%3D21%23wechat_redirect)

扫一扫,关注我

一起学习,一起进步

每周赠书,福利不断

Redis 的 8 大数据类型,写得非常好!

深度内容

推荐加入

欢迎加入知识星球,一起探讨技术架构,交流技术人生。

加入方式,长按下方二维码:

Redis 的 8 大数据类型,写得非常好!

已在知识星球更新如下:

Redis 的 8 大数据类型,写得非常好!

******Redis 的 8 大数据类型,写得非常好! **素质二连,走一个Redis 的 8 大数据类型,写得非常好!

本文分享自微信公众号 - 程序猿DD(didispace)。
如有侵权,请联系 support@oschina.cn 删除。
本文参与“OSC源创计划”,欢迎正在阅读的你也加入,一起分享。

点赞
收藏
评论区
推荐文章
blmius blmius
3年前
MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1
文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s
待兔 待兔
3个月前
手写Java HashMap源码
HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程22
Wesley13 Wesley13
3年前
SQL 优化极简法则,还有谁不会?
点击上方蓝色“方志朋”,选择“设为星标”回复“666”获取独家整理的学习资料!!(https://oscimg.oschina.net/oscnet/be36ac58a54c46698d39cc2499bf68d2.jpg)文章目录法则一:只返回需要的结果法则二:确保查询使用了正确的索引
Stella981 Stella981
3年前
Gradle 6.6 发布,引入配置缓存特性,大幅提升构建性能
点击上方蓝色“程序猿DD”,选择“设为星标”回复“资源”获取独家整理的学习资料!!(https://oscimg.oschina.net/oscnet/65e7f42744ec4d9ea97ca391fcbe1d6c.jpg)来源|https://www.oschina.net/news/117987/gradle66
Stella981 Stella981
3年前
Docker 部署SpringBoot项目不香吗?
  公众号改版后文章乱序推荐,希望你可以点击上方“Java进阶架构师”,点击右上角,将我们设为★“星标”!这样才不会错过每日进阶架构文章呀。  !(http://dingyue.ws.126.net/2020/0920/b00fbfc7j00qgy5xy002kd200qo00hsg00it00cj.jpg)  2
Stella981 Stella981
3年前
ClickHouse大数据领域企业级应用实践和探索总结
点击上方蓝色字体,选择“设为星标”回复”资源“获取更多资源!(https://oscimg.oschina.net/oscnet/bb00e5f54a164cb9827f1dbccdf87443.jpg)!(https://oscimg.oschina.net/oscnet/dc8da835ff1b4
Stella981 Stella981
3年前
200的大额人民币即将面世?央行:Yes!
点击上方蓝字关注我们!(https://oscimg.oschina.net/oscnet/2a1c2ac00bf54458a78c48a6c2e547d5.png)点击上方“印象python”,选择“星标”公众号重磅干货,第一时间送达!!(
Stella981 Stella981
3年前
Dubbo 高危反序列化漏洞,存在远程代码执行风险,建议及时升级到2.7.7或更高版本!
点击上方蓝色“程序猿DD”,选择“设为星标”回复“资源”获取独家整理的学习资料!!(https://oscimg.oschina.net/oscnet/cffa04b4accbc940e13443c3b8133e34349.jpg)!(https://oscimg.oschina.net/oscnet/bf22b96b8e650e
Stella981 Stella981
3年前
Spring bean 加载顺序导致的 bug 问题
!(https://oscimg.oschina.net/oscnet/d42f535eafac4c57932f41deeb600794.gif)点击上方蓝色“大数据实战演练”,选择“设为星标”或“置顶”回复“资源”领取独家整理的学习资料!!(https://oscimg.oschina.net/oscnet/ce05d6d20
Wesley13 Wesley13
3年前
Java实现单链表、栈、队列三种数据结构
点击上方蓝色“方志朋”,选择“设为星标”回复“666”获取独家整理的学习资料!!(https://oscimg.oschina.net/oscnet/afd13d028bc54aafb0ac61f32407b94d.jpg)_作者:远航_cnblogs.com/yangguangzhang/p/13884023.html