Spring Data Redis

一、前言
       刚刚接触Redis不久,对项目中存在的几个Bean都是干嘛用的,一直不理解。这些Bean包括:redisConnectionFactory、redisTemplate、redisCacheManager和jedis。
1. redisConnectionFactory: 集中管理连接
2. redisTemplate:
    2.1 原文:The template offers a high-level abstraction for Redis interactions. While RedisConnection offers low level methods that accept and return binary values (byte arrays), the template takes care of serialization and connection management, freeing the user from dealing with such details.
    2.2 说明:从2.1我们可以看出redisTemplate提供了一个更高抽象级别做交互。
3. redisCacheManager:
    当我们把Redis作为缓存使用时,可以结合Spring Cache相关。此时用到了redisCacheManager。
4. jedis
    jedis客户端,像操作数据库一样, 使用redis的原生命令执行操作。
    疑问:为什么使用redisTemplate:官网上的回答:Once configured, the template is thread-safe and can be reused across multiple instances.

二、RedisTemplate中提供的操作视图
    

       从上图可以发现,redisTemplate提供了各种redis基本数据类型的操作。

三、官方文档

、关键词等记录
4.1    Redis高可用 RedisSentinelConfiguration
4.2   As with the other Spring templates, RedisTemplate and StringRedisTemplate allow the developer to talk directly to Redis through the RedisCallback interface. This gives complete control to the developer as it talks directly to the RedisConnection. Note that the callback receives an instance of StringRedisConnection when a StringRedisTemplate is used.
4.3  序列化相关

 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值