Lettuce 7.7: The Java Redis Client That Gives You Sync, Async, and Reactive in One Connection
Advanced Java Redis client for thread-safe sync, async, and reactive usage. Supports Cluster, Sentinel, Pipelining, and codecs.
At a glance
- What is it?
- Lettuce is a thread-safe Java Redis client built on Netty that supports synchronous, asynchronous, and reactive APIs from a single connection. This review covers its architecture, setup, limitations, and where it fits compared to alternatives like Jedis.
- Who is it for?
- Adopt Lettuce if you need a single client that handles sync, async, and reactive workloads without managing multiple connection types, especially in Spring Boot or reactive stacks. Skip it if your team is unfamiliar with Netty-based connection lifecycle or if you require strict blocking command semantics on shared connections.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 2 days ago.
- What is it written in?
- Mainly Java, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on September 14, 2026, and from our analysis. They are not legal advice.
DEEP OPEN-SOURCE ANALYSIS
Why Lettuce Exists: Solving the Connection Sharing Problem
Most Java Redis clients tie one connection to one thread. That works for small apps but fails when you have many threads or need non-blocking I/O. Lettuce attacks this directly: it is a thread-safe client where multiple threads can share a single connection, provided they avoid blocking and transactional commands like BLPOP and MULTI/EXEC. The README states this explicitly. The design target is scalability without connection explosion. For a service handling hundreds of concurrent requests, sharing one or a few connections reduces overhead compared to opening a connection per thread. The trade-off is discipline: you must know which commands break the sharing model. That constraint is the core of Lettuce's value and its sharp edge.
Netty Under the Hood: How the Three APIs Share One Pipeline
Lettuce is built on Netty, an event-driven network framework. This is not a cosmetic detail. Netty gives Lettuce a non-blocking I/O core that can multiplex many Redis commands over one TCP connection. The same underlying connection exposes three command interfaces: sync, async, and reactive. The sync API blocks the calling thread until the response arrives. The async API returns RedisFuture objects, which you can combine with LettuceFutures.awaitAll. The reactive API returns Project Reactor types like Mono and Flux. All three sit on top of the same Netty pipeline, which is why you can switch styles without changing connection setup. The README shows that a single StatefulRedisConnection can spawn sync, async, or reactive command objects. That unification is the architectural point. It also means you get auto-reconnect and pipelining for free, as those are features of the connection layer, not the command layer.
Getting Started: Maven Coordinates and the Minimal Sync Example
You pull Lettuce from Maven Central with the dependency io.lettuce:lettuce-core. The README gives a version placeholder, but the current release is 7.7.0.RELEASE. A minimal sync example is three lines: create a RedisClient with a URI, connect to get a StatefulRedisConnection, then call connection.sync() to get command objects like RedisStringCommands. The command methods mirror the lowercase Redis command names, with CamelCased modifiers for variants, for example zrangebyscore and zrangebyscoreWithScores. For async, you call connection.async() and get RedisFuture objects. For reactive, you call connection.reactive() and get Mono or Flux. The build process uses Maven and a Makefile that starts multiple Redis instances for tests. If you want snapshots of the upcoming major version, the README points to the Sonatype snapshot repository. That is straightforward for a library that has been around this long.
Where the Shared Connection Model Bites: Blocking and Transactions
The biggest limitation is the shared-connection constraint. The README warns that multiple threads may share one connection if they avoid blocking and transactional operations such as BLPOP and MULTI/EXEC. That is not a minor footnote. If you use blocking commands like BLPOP on a shared connection, one thread can block the entire pipeline, stalling every other thread that shares it. Transactions like MULTI/EXEC have similar issues because they require a dedicated connection to maintain state. The wrong tool is any workload that heavily relies on blocking pops or long-running transactions. You can work around it by opening a separate connection for those commands, but that defeats the sharing benefit. The documentation does not offer an automatic solution. You have to design around it. This is a real cost that the README does not sugarcoat.
Beyond Basic Commands: Cluster, Sentinel, and Codecs
Lettuce supports Redis Cluster and Sentinel for high availability and sharding. The README links to dedicated sections for each. Cluster support means you can talk to a cluster of Redis nodes without manually routing keys. Sentinel support gives you automatic failover handling. The client also supports SSL and Unix Domain Socket connections, which matter for secure or local deployments. Codecs are another layer: you can define how Redis data maps to Java objects, with examples like UTF8, bit, and JSON. The README mentions support for RediSearch, RedisJSON, and Redis Vector Sets, which extends the client beyond plain key-value operations. For a team using Redis modules, that integration is a differentiator. The trade-off is complexity: each feature adds configuration surface. The README does not give code examples for these, so you will need the reference documentation to set them up.
Alternatives: Jedis and the Sync-Only Mindset
The main alternative in Java is Jedis. The difference is fundamental. Jedis is not thread-safe by default; you typically use a connection pool to manage multiple connections. That works but adds overhead and complexity under high concurrency. Lettuce's approach is to share connections safely, which reduces the number of open sockets. For reactive programming, Jedis has a separate reactive module that is less integrated. Lettuce has reactive support built into the same connection. If your application is synchronous and simple, Jedis may be easier to reason about because you do not have to worry about blocking commands on a shared connection. If you are building a reactive or async service, Lettuce's unified API is a stronger fit. The choice is not about features alone; it is about your concurrency model.
Maintenance, License, and Upgrade Considerations
Lettuce is licensed under MIT, which is permissive and allows commercial use without copyleft obligations. The repository is actively maintained; the last push was August 2026, and 7.7.0.RELEASE came out the same day. The versioning uses a .RELEASE suffix, which is unusual for Java libraries but consistent with Spring's release train. Upgrades are a normal Maven version bump, but you should check the release notes for breaking changes. The README says the client is tested against the latest Redis source-build, which suggests close tracking of Redis development. That is a positive for compatibility but also means new Redis features may require a Lettuce upgrade. The codebase is a fork of an older project, but it has been under Redis's umbrella for years. For maintenance cost, the main burden is understanding the connection lifecycle and the shared-connection rules, not the library's own upkeep.
Editorial conclusion
Adopt Lettuce if you need a single client that handles sync, async, and reactive workloads without managing multiple connection types, especially in Spring Boot or reactive stacks. Skip it if your team is unfamiliar with Netty-based connection lifecycle or if you require strict blocking command semantics on shared connections. Before adopting, verify your Redis version compatibility with the 7.7 release notes, confirm your codec needs (e.g., JSON via RedisJSON), and test how your blocking commands like BLPOP behave under concurrent access, because the shared-connection model forbids them.
Community notes