whatisgithub

What is lettuce?

redis/lettuce — explained in plain English

Analysis updated 2026-06-26

5,739JavaAudience · developerComplexity · 3/5LicenseSetup · easy

In one sentence

Lettuce is the official Java library for connecting to Redis, supporting synchronous, asynchronous, and reactive programming styles in one package with support for Redis Cluster and Sentinel.

Mindmap

mindmap
  root((lettuce))
    Programming styles
      Synchronous
      Asynchronous
      Reactive
    Redis features
      Redis Cluster
      Redis Sentinel
      SSL encryption
    Modules
      RediSearch
      RedisJSON
      Vector Sets
    Setup
      Maven dependency
      Gradle dependency
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Connect a Java or Spring Boot application to Redis for caching, session storage, or real-time features.

USE CASE 2

Use Redis Cluster or Sentinel for high-availability data storage in a Java microservice.

USE CASE 3

Stream Redis commands reactively in a Spring WebFlux application without blocking threads.

USE CASE 4

Store and query JSON documents or run vector similarity searches in Redis from a Java app.

What is it built with?

JavaRedisMavenGradle

How does it compare?

redis/lettucejagrosh/musicbotk0shk0sh/fasthub
Stars5,7395,7405,738
LanguageJavaJavaJava
Setup difficultyeasymoderatemoderate
Complexity3/52/53/5
Audiencedevelopergeneraldeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 30min

Add Lettuce to your Maven or Gradle build file, requires a running Redis instance to connect to.

Apache 2.0, use freely in commercial Java projects with attribution.

So what is it?

Lettuce is a Java library that lets applications talk to Redis, a popular in-memory data store often used for caching, session storage, and real-time features. The library is maintained by Redis and handles the low-level work of opening connections, sending commands, and receiving results. What sets Lettuce apart from other Redis clients for Java is its support for three different programming styles in a single package. Synchronous usage means your code waits for each Redis command to finish before moving on, which is the simplest approach. Asynchronous usage means your code fires off commands and gets back a future object that will eventually contain the result, so other work can happen in the meantime. Reactive usage follows a stream-based model popular in modern Java frameworks, where you describe how to handle results when they arrive rather than waiting for them directly. All three styles share the same underlying connection, which is designed to be safe for use across multiple threads without creating a separate connection per thread. The library also supports Redis Sentinel and Redis Cluster, which are two ways to run Redis across multiple servers for higher reliability or bigger data sets. It handles automatic reconnection if the connection drops, encrypted connections over SSL, and different ways to encode your data, such as JSON or custom binary formats. For developers working with newer Redis features, the library includes support for RediSearch, RedisJSON, and Redis Vector Sets, which are add-ons that turn Redis into a search engine, a JSON document store, or a vector similarity store respectively. The library is available through Maven Central, the standard package registry for Java projects, so adding it to an existing Java project is a matter of adding a few lines to a build configuration file.

Copy-paste prompts

Prompt 1
Show me how to connect to Redis using Lettuce in a Spring Boot app and read and write a simple string key.
Prompt 2
How do I use Lettuce's reactive API to send multiple Redis commands as a pipeline in a Spring WebFlux service?
Prompt 3
Set up Lettuce to connect to a Redis Cluster with automatic failover, show me the connection configuration code.
Prompt 4
How do I store and query JSON documents in Redis using Lettuce with the RedisJSON module enabled?

Frequently asked questions

What is lettuce?

Lettuce is the official Java library for connecting to Redis, supporting synchronous, asynchronous, and reactive programming styles in one package with support for Redis Cluster and Sentinel.

What language is lettuce written in?

Mainly Java. The stack also includes Java, Redis, Maven.

What license does lettuce use?

Apache 2.0, use freely in commercial Java projects with attribution.

How hard is lettuce to set up?

Setup difficulty is rated easy, with roughly 30min to a first successful run.

Who is lettuce for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.