Spring data redis:

要求:

  • Redis 版本 > 2.6
  • 与 Lettuce 或 Jedis 集成,两种java开源Redis库.

Spring redis主要做的两件事:

  • 连接Redis,不管使用哪种库,RedisConnection以及RedisConnectionFactory只能使用一套API进行Redis连接或操作
  • 通过RedisTemplate操作Redis数据。RedisTemplate 提供高层抽象的redis 交互。
Iteration Description
GeoOperation Redis geospatial opertations, such as GEOADD, GEORADIUS,...
HashOperations Redis hash operations
HyperLogLogOperations Redis HyperLogLog operations, such as PFADD, PFCOUNT,...
ListOperations Redis list operations
SetOperations Redis set operations
ValueOperations Redis string (or value) operations
ZSetOperations Redis zset (or sorted set) operations
BoundGeoOperations Redis key bound geospatial operations
BoundHashOperations Redis hash key bound operations
BoundKeyOperations Redis key bound operations
BoundListOperations Redis list key bound operations
BoundSetOperations Redis set key bound operationsBoundValueOperations
BoundZSetOperations Redis zset (or sorted set) key bound operations

现在尝试一把使用Spring redis。

  • gradle 配置依赖库

  • spring redis 配置,这里使用最简单的配置,配置的值,例如连接redis的端口号是默认的

  • 使用HashOperations实现前面提到的user数据类型的存储。

  • 命令行查看redis里面的数据。

粉丝和关注功能实现,这里暂时就不实现了。

最新文章

  1. init.d functions的daemon函数
  2. systemctl命令用法详解
  3. bat批处理重命名问题
  4. iOS之下拉放大,上推缩小,一个方法搞定
  5. Android 摇一摇 之 震动片
  6. ng-repeat 嵌套 ng-switch 出错解决
  7. .NET下dropdownlist的基本操作
  8. php中重写和final关键字的使用
  9. 生成apache证书(https应用)
  10. useradd adduser linux创建用户、设置密码、修改用户、删除用户
  11. mongoDB中的连接池(转载)
  12. 9.27 noip模拟试题
  13. 洛谷2344 奶牛抗议(DP+BIT+离散化)
  14. 包含无数好东西的ownCloud
  15. xyiyy开始写博客了
  16. XML字符串转化json
  17. GridView行编辑、更新、取消、删除事件使用方法
  18. 简介支持向量机热门(认识SVM三位置)
  19. C语言总结
  20. 如何禁用 .net reflector

热门文章

  1. 移动端tap事件的封装
  2. Android浮动按钮
  3. Oracle replace()函数
  4. 几种常见的Windows 服务器无法联网/无法连接远程桌面等故障解决方案
  5. Azure 中快速搭建 FTPS 服务
  6. ORM------多表操作
  7. 用POP动画模拟真实秒钟摆动效果
  8. 细嚼慢咽C++primer(4)——类(1):构造函数,类型别名
  9. 沉淀再出发:web服务器和应用服务器之间的区别和联系
  10. HTTP协议图--HTTP 协议基础