# redis/lettuce

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/redis-lettuce).**

5,722 stars · 1,074 forks · Java · mit

## Links

- GitHub: https://github.com/redis/lettuce
- Homepage: https://lettuce.io
- awesome-repositories: https://awesome-repositories.com/repository/redis-lettuce.md

## Topics

`asynchronous` `aws-elasticache` `azure-redis-cache` `java` `reactive` `redis` `redis-client` `redis-cluster` `redis-sentinel`

## Description

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.

## Tags

### Data & Databases

- [Redis Clients](https://awesome-repositories.com/f/data-databases/redis-clients.md) — A non-blocking, thread-safe Redis client library for Java supporting synchronous, asynchronous, and reactive models. ([source](https://cdn.jsdelivr.net/gh/redis/lettuce@main/README.md))
- [Redis Drivers](https://awesome-repositories.com/f/data-databases/asynchronous-database-drivers/redis-drivers.md) — Sends Redis commands asynchronously and returns RedisFuture objects for non-blocking completion handling. ([source](https://redis.github.io/lettuce/user-guide/async-api/))
- [Redis](https://awesome-repositories.com/f/data-databases/connection-managers/redis.md) — Discovers the current Redis master through Sentinel nodes and maintains the connection. ([source](https://cdn.jsdelivr.net/gh/redis/lettuce@main/README.md))
- [Reactive Programming Models](https://awesome-repositories.com/f/data-databases/connection-managers/redis/reactive-programming-models.md) — Builds non-blocking Redis workflows with reactive streams for backpressure-aware data processing.
- [Primary-Replica Replication](https://awesome-repositories.com/f/data-databases/primary-replica-replication.md) — Establishes connections to Redis master and replicas, routing commands by role. ([source](https://redis.github.io/lettuce/ha-sharding/))
- [Reactive Redis Query Executors](https://awesome-repositories.com/f/data-databases/reactive-query-engines/reactive-sql-query-execution/reactive-redis-query-executors.md) — Issues Redis commands reactively, returning Mono/Flux streams for non-blocking, backpressure-aware processing. ([source](https://cdn.jsdelivr.net/gh/redis/lettuce@main/README.md))
- [Cluster Clients](https://awesome-repositories.com/f/data-databases/redis-clients/cluster-clients.md) — Executes commands across a Redis Cluster with automatic slot routing, redirect handling, and topology discovery.
- [Cluster Connectivity](https://awesome-repositories.com/f/data-databases/redis-clients/cluster-connectivity.md) — Distributes commands across cluster nodes and handles slot redirections automatically. ([source](https://cdn.jsdelivr.net/gh/redis/lettuce@main/README.md))
- [Pub/Sub Clients](https://awesome-repositories.com/f/data-databases/redis-clients/pub-sub-clients.md) — Provides a Redis pub/sub client for subscribing to channels and receiving real-time messages.
- [Sentinel Clients](https://awesome-repositories.com/f/data-databases/redis-clients/sentinel-clients.md) — Discovers the current master through Sentinel nodes and maintains connections during automatic failover.
- [Client Failover Integrations](https://awesome-repositories.com/f/data-databases/sentinel-management/client-failover-integrations.md) — Connects to Redis via Sentinel for automatic master discovery and failover in high-availability setups.
- [Slot-Based Routing](https://awesome-repositories.com/f/data-databases/slot-based-routing.md) — Routes commands by hash slot across Redis Cluster nodes, handling MOVED and ASK redirects transparently.
- [Data Serialization Codecs](https://awesome-repositories.com/f/data-databases/data-serialization-codecs.md) — Transforms Java objects to Redis wire format using pluggable serializers for UTF-8, JSON, or binary content. ([source](https://cdn.jsdelivr.net/gh/redis/lettuce@main/README.md))
- [Pluggable Serializers](https://awesome-repositories.com/f/data-databases/data-serialization-formats/data-formats/object-serializers/pluggable-serializers.md) — Transforms Java objects to Redis wire format through configurable serializers supporting UTF-8, JSON, and binary encoding.
- [Full Text Search](https://awesome-repositories.com/f/data-databases/full-text-search.md) — Provides full-text search capabilities including term, phrase, boolean, wildcard, and fuzzy queries on indexed Redis documents. ([source](https://redis.github.io/lettuce/user-guide/redis-search/))
- [Result Streaming](https://awesome-repositories.com/f/data-databases/query-result-fetching/result-streaming.md) — Streams large Redis collection results incrementally via callbacks to avoid heap memory exhaustion.
- [Read Replica Routing Preferences](https://awesome-repositories.com/f/data-databases/read-replicas/replica-set-deletion/read-replica-routing-preferences.md) — Selects which nodes handle read operations to balance consistency, latency, and availability. ([source](https://redis.github.io/lettuce/ha-sharding/))
- [Cluster Topology Management](https://awesome-repositories.com/f/data-databases/redis-clients/cluster-topology-management.md) — Updates the cluster node map periodically or adaptively in response to redirects and disconnects. ([source](https://redis.github.io/lettuce/ha-sharding/))
- [Search Clients](https://awesome-repositories.com/f/data-databases/redis-clients/search-clients.md) — Ships a Redis search client that creates indexes and runs full-text, vector, geospatial, and auto-complete queries.
- [Index Definitions](https://awesome-repositories.com/f/data-databases/search-indexing-technologies/search-indexing/search-and-indexing/index-definitions.md) — Defines which fields and data sources to index, enabling full-text, numeric, tag, geo, and vector searches on Redis documents. ([source](https://redis.github.io/lettuce/user-guide/redis-search/))
- [Topology Discoverers](https://awesome-repositories.com/f/data-databases/sentinel-management/topology-discoverers.md) — Discovers the current Redis master through Sentinel nodes and maintains automatic failover and topology updates.
- [Vector Similarity Search](https://awesome-repositories.com/f/data-databases/vector-similarity-search.md) — Finds semantically similar documents by comparing query embeddings against indexed vector fields using configurable distance metrics. ([source](https://redis.github.io/lettuce/user-guide/redis-search/))

### Security & Cryptography

- [Redis Connection Authentications](https://awesome-repositories.com/f/security-cryptography/connection-authentication-mechanisms/redis-connection-authentications.md) — Ships built-in authentication for Redis connections supporting username/password and token-based credentials at connection time. ([source](https://redis.github.io/lettuce/user-guide/connecting-redis/))

### Software Engineering & Architecture

- [Connection Models](https://awesome-repositories.com/f/software-engineering-architecture/thread-safe-logging/connection-models.md) — Provides a single thread-safe connection that handles all command execution models without blocking.
- [Reactive Command Composers](https://awesome-repositories.com/f/software-engineering-architecture/functional-reactive-programming-frameworks/reactive-command-composers.md) — Composes multiple Redis operations by flat-mapping over reactive types for non-blocking chaining. ([source](https://redis.github.io/lettuce/user-guide/reactive-api/))
- [Future-Based Concurrency Frameworks](https://awesome-repositories.com/f/software-engineering-architecture/future-based-concurrency-frameworks.md) — Returns RedisFuture objects from asynchronous commands for non-blocking completion handling and chaining.

### Web Development

- [Reactive Stream Integrations](https://awesome-repositories.com/f/web-development/reactive-stream-libraries/reactive-stream-integrations.md) — Wraps Redis responses in Project Reactor's Mono and Flux types for non-blocking, backpressure-aware data processing.

### Networking & Communication

- [Callback-Based Data Streaming](https://awesome-repositories.com/f/networking-communication/callback-based-data-streaming.md) — Streams large Redis collection results through callback interfaces as data arrives. ([source](https://redis.github.io/lettuce/advanced-usage/streaming-api))
- [Publish-Subscribe Messaging](https://awesome-repositories.com/f/networking-communication/communication-platforms-services/messaging-notification-systems/messaging-services/message-broker-infrastructure/publish-subscribe-messaging.md) — Broadcasts messages to channels and receives messages from subscribed channels using a listener pattern. ([source](https://lettuce.io))
- [Pub-Sub Subscriptions](https://awesome-repositories.com/f/networking-communication/messaging-channel-management/pub-sub-subscriptions.md) — Registers a listener to receive messages published to Redis channels, enabling real-time messaging patterns. ([source](https://cdn.jsdelivr.net/gh/redis/lettuce@main/README.md))
- [Transport Abstractions](https://awesome-repositories.com/f/networking-communication/transport-abstractions.md) — Switches network I/O to platform-specific JNI transports like epoll or io_uring for higher throughput.
