随笔分类 -  Redis

Redis过期策略
摘要:一、设置过期时间 expire key time(以秒为单位) -- 这是最常用的方式 setex(String key, int seconds, String value) -- 字符串独有的方式 注:除了字符串自己独有设置过期时间的方法外,其他数据类型都需要依靠expire方法来设置过期时间。 阅读全文
posted @ 2019-04-12 22:26 lin-gooo 阅读(213) 评论(0) 推荐(0)
Redis&持久化存储
摘要:Redis支持的数据类型: string(字符串),hash(哈希),list(列表),set(集合)及zset(sorted set:有序集合)。 string类型是Redis最基本的数据类型,一个键最大能存储512MB。 用buf数组存储字符串的内容,但数组的长度会大于所存储内容的长度。会有一格 阅读全文
posted @ 2019-04-09 18:26 lin-gooo 阅读(444) 评论(0) 推荐(0)