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

redis应用01:values数据结构/类型,过期设置_第1张图片
正确理解sorted sets.png

Redis expires: keys with limited time to live

你可能感兴趣的:(redis应用01:values数据结构/类型,过期设置)