概述 Redis作为一款性能优异的内存数据库,在互联网公司有着多种应用场景,本文将介绍Redis如何在项目中合理使用。 背景 Redis 是一个开源的内存数据结构存储系统。 可以作为数据库、缓
概述
Redis作为一款性能优异的内存数据库,在互联网公司有着多种应用场景,本文将介绍Redis如何在项目中合理使用。
背景
基本数据类型
字符串(strings)
1、string 的过期时间在重新设置值之后会被清除
127.0.0.1:6379> set hello 3
OK
127.0.0.1:6379> get hello
"3"
127.0.0.1:6379> ttl hello
(integer) -1
127.0.0.1:6379> expire hello 3000
(integer) 1
127.0.0.1:6379> set hello 4
OK
127.0.0.1:6379> ttl hello
(integer) -1
--结束END--
本文标题: Redis如何在项目中合理使用经验分享
本文链接: https://www.lsjlt.com/news/52336.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-05-14
2024-05-14
2024-05-14
2024-05-14
2024-05-14
2024-05-14
2024-05-14
2024-05-14
2024-05-14
2024-05-14
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0