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中提供的操作视图
    
Spring Data Redis
       从上图可以发现,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  序列化相关
Spring Data Redis