Skip to content

About Lettuce

Mark Paluch edited this page Aug 9, 2019 · 2 revisions

Lettuce is a scalable thread-safe Redis client providing synchronous, asynchronous and reactive APIs. Multiple threads may share one connection if they avoid blocking and transactional operations such as BLPOP and MULTI/EXEC. Multiple connections are efficiently managed by the excellent netty NIO framework. Support for advanced Redis features such as Sentinel, Cluster, and Redis data models is included.

So, why Lettuce?

Lettuce was originally written by Will Glozer as scalable and thread-safe Java Redis client. It was the most advanced client providing the greatest Redis command coverage, but the maintenance stopped somewhere mid-2013.

It started with a project on which I worked on. I had to integrate Redis for collecting logs during integration tests. I tried several, available clients. Every one of them had issues with unstable connections, library issues (external libraries that get in conflict with the existing project dependencies) or was just not up to date. I was experiencing connections drops in my environment; sometimes there is a lot of traffic, and sometimes the connection is idle for hours.

Based on my research, Lettuce was the best choice amongst all. Lettuce provides async handling out of the box; it can reconnect inactive connections. The only problem: It’s not up to date, and the last release was one year ago. I’ve added the latest features including Sentinel and cluster support and opened a pull request, but there was no real interest in merging the changes back into Lettuce. After some controversy on this, I’ve decided to publish my fork of Lettuce. My vision for Lettuce is becoming the best Redis client available.

Clone this wiki locally