Let's Start with a quick Introduction.

What is Redis

Redis is an open-source, in-memory data structure store used as a database, cache, message broker, and streaming engine. Redis provides data structures such as strings, hashes, lists, sets, and sorted sets with range queries, bitmaps, hyperloglogs, geospatial indexes, and streams. Redis has built-in replication, Lua scripting, LRU eviction, transactions, and different levels of on-disk persistence, and provides high availability via Redis Sentinel and automatic partitioning with Redis Cluster.

What is clustered Redis

Redis Cluster is a distributed implementation of the Redis data store that allows data to be sharded across multiple Redis nodes. In a Redis Cluster, data is partitioned across multiple Redis nodes, so that each node only holds a portion of the total data set. A cluster is divided up among 16,384 slots — the maximum number of nodes or shards in a Redis cluster. Below image shows cluster architecture of redis which contains two node groups and slots are divided equally among them

None

What is Lettuce

Lettuce is a Redis Java client that is fully non-blocking. It supports both synchronous and asynchronous communication. Its complex abstractions allow you to scale products easily.

What is Jedis

Jedis is a client library inside Redis that's designed for performance and ease of use. Jedis is a lightweight offering compared to other Redis Java clients; it offers fewer features but can still handle large amounts of memory.

When to use Lettuce over Jedis

  • When you want to read from the slave/Replica. Lettuce provides out-of-the-box implementation for reading from the slave.
  • Lettuce supports Asynchronous calls with Redis cluster.
  • Lettuce supports automatic topology refresh based on triggers.

Lettuce is complex to use but provides more flexibility while working with the Redis cluster.