Spring Data Redis

Plug Redis into your Spring application with minimal effort

Spring Data Redis integrates Redis with the Spring framework, letting you plug Redis into your Spring application with minimal effort. It works with the Lettuce and Jedis clients, so Spring applications can take advantage of those clients' connection features as well as Spring's own abstractions.

Requirements

The examples in this section use Spring Boot 4.1 with Spring Data Redis 4.1. Add the Spring Boot starter for Spring Data Redis to your project:

<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>

The starter uses the Lettuce client by default. Spring Boot reads the connection settings from your application properties:

spring.data.redis.host=<your-redis-host>
spring.data.redis.port=6379

Spring Boot creates a RedisConnectionFactory and a StringRedisTemplate for you, and the pages in this section build on them.

Recipes

The pages in this section describe recipes for using Redis from Spring Data Redis:

RATE THIS PAGE
Back to top ↑