Skip to content

Spring Data Redis

Spring Data Redis is the module within the Spring Framework that provides easy configuration and access to Redis from Spring applications^[600-developer-spring-springboot-data-redis.md].

Core Components

The framework facilitates interaction with Redis through several key abstractions, primarily focusing on connection management and data operations^[600-developer-spring-springboot-data-redis.md].

Connection Management

To handle the communication layer with the Redis server, Spring Data Redis utilizes the following interfaces^[600-developer-spring-springboot-data-redis.md]:

  • RedisConnection: Represents an active, lightweight connection to the Redis server.
  • RedisConnectionFactory: Acts as a factory for creating and managing these RedisConnection instances.

Data Operations

Data manipulation is primarily performed using the RedisTemplate class, which categorizes operations into two distinct types^[600-developer-spring-springboot-data-redis.md]:

  • Key Type Operations: Generic operations provided for specific data types (or keys) exposed by the Redis server.
  • Key Bound Operations: Operations that are bound to a specific key, allowing for commands scoped to that particular key.

Sources

^[600-developer-spring-springboot-data-redis.md]