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

正确理解sorted sets.png

Redis expires: keys with limited time to live

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 文章已经放到github上 ,如果对您有帮助 请给个star[https://github.com/qqxuanl...
    尼尔君阅读 2,290评论 0 22
  • 超强、超详细Redis入门教程 转载2017年03月04日 16:20:02 16916 转载自: http://...
    邵云涛阅读 17,494评论 3 313
  • 本文是我自己在秋招复习时的读书笔记,整理的知识点,也是为了防止忘记,尊重劳动成果,转载注明出处哦!如果你也喜欢,那...
    波波波先森阅读 3,441评论 0 40
  • 【本教程目录】 1.redis是什么2.redis的作者3.谁在使用redis4.学会安装redis5.学会启动r...
    徐猿猿阅读 1,871评论 0 35
  • 来源:脚本之家 这篇文章主要介绍了超强、超详细Redis入门教程,本文详细介绍了Redis数据库各个方面的知识,需...
    shenyoujian阅读 851评论 1 10