Lettuce is a scalable, thread-safe Redis client for Java supporting synchronous, asynchronous, and reactive APIs. It is built on Netty and targets current Redis server features.
Overview
Lettuce connects Java applications to Redis with synchronous, asynchronous, and reactive command interfaces. Multiple threads can share one connection when they avoid blocking and transactional operations such as BLPOP and MULTI/EXEC.
The client supports Redis Sentinel and Cluster deployments, pipelining, auto-reconnect, SSL and Unix domain sockets, streaming APIs, and pluggable codecs for UTF-8, binary, JSON, and other encodings. It also covers modules such as RediSearch, RedisJSON, and Redis Vector Sets, and is compatible with Java 8 and later.
Redis commands map to Java methods named after the lowercase Redis command, with camel-cased modifiers where result types differ. Pub/sub usage follows dedicated connection types and listener APIs.
Binaries ship through Maven Central and other package ecosystems, with reference documentation and Javadoc for API details. The client has been tested against up-to-date Redis builds.
Key features
- Sync, async, and reactive APIs
- Redis Sentinel and Cluster
- Pipelining and auto-reconnect
- SSL and Unix domain sockets
- Streaming API
- Configurable data codecs
- RediSearch and RedisJSON support
- Pub/sub connections
Use cases
- Java apps talking to Redis
- Reactive Redis workloads
- Clustered or Sentinel Redis
- Cached or session data access
- Pub/sub messaging in Java