Lettuce is a Redis client library for Java that provides synchronous, asynchronous, and reactive programming models for interacting with Redis databases. It supports standalone, cluster, sentinel, pub/sub, and search operations through a single thread-safe connection model that handles command execution without blocking the calling thread.
The library distinguishes itself through its reactive streams integration with Project Reactor, enabling non-blocking, backpressure-aware data processing with Mono and Flux types. It offers cluster slot routing that transparently handles MOVED and ASK redirects, sentinel-based topology discovery for automatic failover, and native transport abstraction that switches network I/O to platform-specific JNI transports like epoll or io_uring for reduced garbage collection and higher throughput. Lettuce also supports streaming result processing through callbacks to avoid full memory materialization of large collection results.
Beyond core Redis operations, Lettuce provides domain-specific capabilities including Redis Search and Query for full-text, vector similarity, geospatial, and auto-complete operations, as well as pub/sub messaging for real-time broadcasting and reception. The library includes pluggable codec architecture for transforming Java objects to Redis wire format, authentication mechanisms supporting username/password and token-based credentials with automatic refresh, and configuration options for read preferences, static node topologies, and cross-slot multi-key command execution in cluster environments.