redis应用01:values数据结构/类型,过期设置

redis内存策略,
集群,redis分区

values支持的数据结构/类型

过期时间设置,

redis事务

Redis发送订阅

Redis备份

Redis管道

redis存储结构

https://redis.io/topics/data-types-intro

https://www.yiibai.com/redis/redis_quick_guide.html

redis中没有表,
每条记录都是以keys-values数据结构存在,
keys必须是String类型的,但是values可以是
strings,Lists,Sets,Sorted sets,Hashes这五种数据结构,都是作为value的数据结构/类型;

因此redis中,keys是一条记录的标识,不可重复;

Redis keys

The maximum allowed key size is 512 MB.

允许最大512MB

Redis Strings
keys的类型,作为keys最大512MB,作为values最大512MB

Values can be strings (including binary data) of every kind, for instance you can store a jpeg image inside a value. A value can't be bigger than 512 MB.

常用的values数据类型

strings,Lists,Sets,Sorted sets,Hashes这五种数据结构,都是作为value的数据结构/类型;

Binary-safe strings.


Lists: collections of string elements sorted according to the order of 
insertion. They are basically linked lists.
元素只能是string

Sets: collections of unique, unsorted string elements.
元素只能是string


Sorted sets, similar to Sets but where every string element is associated 
to a floating number value, called score. The elements are always taken 
sorted by their score, so unlike Sets it is possible to retrieve a range of 
elements (for example you may ask: give me the top 10, or the bottom 
10).
元素只能是string



Hashes, which are maps composed of fields associated with values. Both 
the field and the value are strings. This is very similar to Ruby or Python 
hashes.
key只能是string
value只能是string

4165335-c9e1fbf95fa4873e.png
正确理解sorted sets.png

Redis expires: keys with limited time to live

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值