Spring-boot: Consider Lettuce instead of Jedis as default Redis driver dependency

Created on 2 Oct 2017  路  9Comments  路  Source: spring-projects/spring-boot

Lettuce is the preferred Redis driver for Spring Data Redis and Spring Session supporting the most recent Redis versions. We should consider whether to replace Jedis with the Lettuce driver in spring-boot-starter-data-redis. There are a couple of aspects that play into this request:

  • Lettuce comes with a friendlier performance profile than Jedis.
  • The arrangement with Jedis suffers from changes in the Jedis core development. Features of newer Redis versions are not supported.
  • Requests for a new release were not completed in a timely manner.

On the other side, Lettuce 5 requires Java 8, netty 4.1 and Project Reactor 3.1. It no longer requires Google Guava.

Related issues:

/cc @christophstrobl @rwinch @vpavic

enhancement

Most helpful comment

I'm now in favour of making this switch in 2.0.

All 9 comments

I'm now in favour of making this switch in 2.0.

3 x 馃憤 so I guess we're all in agreement.

This has the interesting side effect of not requiring a dedicated "reactive" starter for redis anymore so it will be removed as part of this change.

Hmm, doesn't the starter also provide Project Reactor?

For example spring-boot-starter-data-cassandra-reactive only provides Reactor on top of what spring-boot-starter-data-cassandra provides so this change makes things inconsistent with Cassandra.

Lettuce already uses reactor. The reason for a separate starter is because the driver is different (as for MongoDB). I don't think we should duplicate the starter only for that reason.

Yes, I'm aware, but if I'm not mistaken reactive dependencies are optional to Lettuce. So the net effect is that the user needs to provide additional dependencies on top of spring-boot-starter-data-redis to make things work while with Cassandra there's spring-boot-starter-data-cassandra-reactive that takes care of that.

I don't have a preference whether spring-boot-starter-data-cassandra-reactive should be removed as well or should spring-boot-starter-data-redis-reactive be reinstated, it's just that thing seems inconsistent.

The dep is mandatory so nothing is really lost. I wonder about the naming inconsistency now. Let's reopen and see what the rest of the team thinks.

The dep is mandatory so nothing is really lost.

My mistake, I've misread the POM. Sorry for the noise.

I think the naming is fine. We have spring-boot-starter-data-redis which provides both reactive and non-reactive support (as I understand it). The reactor-core dependency is mandatory, even in a non-reactive user application.

Was this page helpful?
0 / 5 - 0 ratings