Scrivio Interview library
ConceptFoundations6 min read · updated 13 November 2026

Java services can talk to Redis through Lettuce, Jedis or Redisson. Spring Boot uses Lettuce by default, but teams often add the others for specific features.

Compare the three clients' connection and threading models and their feature focus, and say when you would pick each.

Lettuce runs on Netty and is thread-safe, so all threads share one connection per Redis node and their commands are pipelined over it; it offers sync, async and reactive APIs and is Spring Boot's default. Jedis uses simple blocking connections that are not thread-safe, so each call borrows a connection from a pool. Redisson is a higher-level Netty client built around distributed objects such as locks, semaphores, maps with local caches and rate limiters. I pick Lettuce for general Spring work, Jedis where a plain blocking model is wanted, and Redisson only when its coordination features justify the extra dependency.

Why this question is asked

Choosing a Redis client looks like a small decision, but it decides how many connections each service opens, how a slow command affects other threads, and which features are available without writing them ourselves. Interviewers ask this to check that we understand the threading model under each library, not just its API. In this answer, we will recap what a client has to manage, look at each client's connection and threading model, see what goes wrong when a shared connection meets a blocking command or a huge reply, and finish with when to pick each one.

1A Quick Recap: What a Redis Client Manages

Redis speaks a simple request-and-reply protocol over TCP, and it answers the commands on one connection strictly in the order they arrive. A client library has to decide how application threads map onto connections. Either each thread gets a connection of its own for the duration of a call, which needs a pool, or many threads share one connection and their commands are interleaved on it, which needs a way to match each reply to the right caller. That one decision explains most of the differences between the three clients.

2Lettuce: One Shared Connection, Many Threads

Lettuce is built on Netty, an asynchronous networking library. A Lettuce connection is thread-safe: any number of threads can send commands on it at once. Lettuce writes each command to the socket, puts a matching future in a queue, and completes the futures in order as replies arrive. So a service needs only one connection per Redis node, and commands from many threads are naturally pipelined, sent without waiting for earlier replies.

It offers three APIs over the same connection: sync (blocking calls that wait for their future), async (CompletableFuture-style RedisFuture) and reactive (Project Reactor types). Spring Boot's spring-boot-starter-data-redis uses Lettuce by default.

Java
RedisClient client = RedisClient.create("redis://localhost:6379");
StatefulRedisConnection<String, String> conn = client.connect(); // one per node, shared
conn.sync().set("a", "1"); // "OK", blocks this thread only
RedisFuture<String> f = conn.async().get("a"); // returns at once
f.get(); // "1"
conn.reactive().get("a").subscribe(System.out::println); // prints 1

3Jedis: A Pooled, Blocking Connection per Call

Jedis is a small, direct client. A Jedis connection is a plain blocking socket and is not thread-safe, so two threads must never use one at the same time. Applications use a pool (JedisPool, or the pool inside Spring's JedisConnectionFactory, based on Apache commons-pool2): each call borrows a connection, runs the command, and returns it.

This model is easy to reason about and debug, and a slow command only blocks the thread that sent it. The cost is that throughput depends on pool size. A request holds its connection for the whole call, so with a pool of 8 only 8 threads can talk to Redis at once and the others wait. It also means many more TCP connections per service than Lettuce.

4Redisson: Distributed Objects on Top of Redis

Redisson is also built on Netty, but its focus is different. Instead of exposing Redis commands, it offers Java objects backed by Redis: RLock and fair locks, semaphores, countdown latches, RMap and RLocalCachedMap (a map with a near cache in each JVM, kept in sync through pub/sub), rate limiters, queues and more. It has its own codecs for serializing values.

That saves a lot of code when we need these features, since writing a correct distributed lock or local cache with invalidation is hard. But it is a bigger dependency with its own configuration, and some features exist only in the commercial edition, so check the licence before a team depends on one.

Lettuce, Jedis and Redisson compared
LettuceJedisRedisson
Network layerNetty, non-blockingblocking socketsNetty, non-blocking
Thread-safe connectionyes, sharedno, pooledyes, managed internally
APIssync, async, reactivesyncobjects; sync, async, reactive
Focusfull command coveragesimple direct commandslocks, local caches, limiters
Spring Boot defaultyesoptionalvia its own starter

5The Catch With a Shared Connection

Because Redis answers in order, everything on a shared Lettuce connection queues behind the command in front of it. Blocking commands such as BLPOP or WAIT hold the connection until they return, and MULTI/EXEC transactions need all their commands on one connection with nothing else interleaved. So these need dedicated connections. Spring Data Redis handles this: it uses the shared connection for ordinary commands and takes a dedicated connection, from a pool if commons-pool2 is configured, for blocking commands and transactions.

The less obvious case is a large reply. If one thread runs HGETALL on a hash with 500,000 fields, Redis produces a reply of many megabytes, and every command queued after it on that connection must wait while those bytes cross the network and Lettuce decodes them. For that time, every thread in the service sees higher latency. The remedy is to avoid huge replies (HSCAN in pages, smaller structures) or to send known heavy work over a separate connection.

6When to Pick Each One

With Spring, Lettuce is the default choice: few connections, good throughput, reactive support, and Spring Boot's auto-configuration and metrics around it. Jedis is a reasonable choice when a team prefers a simple blocking model, or for existing code that already uses it, as long as the pool is sized properly. Redisson earns its place when we need its distributed locks, local cached maps or rate limiters and would otherwise write them by hand.

What I would avoid is mixing all three in one service. Each brings its own connections, timeouts, retry behaviour and serializers, and incidents then come from settings that differ between them. If a service needs Redisson features, it can often use Redisson for everything in that service.

7Follow-up questions

Why can one big reply hurt latency for every thread on a Lettuce connection?

Because Redis returns replies on a connection in the order the commands were sent, and Lettuce must read and decode them in that order to complete the right futures. A multi-megabyte reply occupies the socket and the decoding for its whole length, so the small replies queued behind it are delayed even though Redis produced them quickly. On a pooled Jedis setup, only the thread that asked for the big reply would wait.

Is Jedis slower than Lettuce?

Not per command; a single blocking call is very fast. The difference shows under concurrency: Jedis needs one connection per concurrent caller and is limited by pool size, while Lettuce pipelines many callers over one connection. With a well-sized pool, Jedis performs well for typical blocking web services.

Can Lettuce use a connection pool?

Yes. Spring Data Redis creates a pool if commons-pool2 is on the classpath and pool properties are set, and uses it for dedicated connections. For plain Lettuce, ConnectionPoolSupport creates one. For ordinary commands the shared connection is usually faster, so a pool is mainly for blocking commands and transactions.

8Conclusion

In this answer, we compared the three clients by how they map threads onto connections. Lettuce shares one thread-safe Netty connection per node and pipelines all threads' commands over it, with sync, async and reactive APIs. Jedis uses blocking, non-thread-safe connections borrowed from a pool. Redisson adds distributed objects such as locks and local cached maps. Blocking commands, transactions and huge replies are the weak spot of a shared connection, and the usual choice is Lettuce with Spring, Jedis for simple blocking code, Redisson for its coordination features, and not all three in one service.

What to say in the interviewAbout 80 seconds aloud

Open with

The main difference is how threads map onto connections. Lettuce is built on Netty and its connections are thread-safe, so a service keeps one connection per Redis node and all threads pipeline their commands over it.

Then, if they want more

It has sync, async and reactive APIs, and it is Spring Boot's default. Jedis uses blocking sockets that are not thread-safe, so every call borrows a connection from a commons-pool2 pool and holds it for the whole call; throughput depends on the pool size.

Redisson is a higher-level client, also on Netty, that gives us distributed objects: locks, semaphores, maps with a local cache, rate limiters, with its own codecs, and some features are only in the commercial edition.

The weak spot of Lettuce's shared connection is that Redis answers in order, so blocking commands like BLPOP or WAIT and transactions need dedicated connections, which Spring Data Redis takes from a pool if one is configured, and one huge reply delays everything queued behind it.

So with Spring I pick Lettuce by default, Jedis where a team wants a simple blocking model with a properly sized pool, and Redisson when its locks or local caches save real work. I avoid mixing all three in one service, because each brings its own timeouts and serializers.

About this answer

Last updated
13 November 2026
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Official documentation
Redis documentation
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "Compare the three clients' connection and threading models and their feature focus, and...": https://scrivio-interview-library.netlify.app/databases/redis-scaling/e821a84062/