What is the difference between Redis: Jedis and RedisTemplate?

how do I choose to use it?

Mar.13,2021

Jedis is a client officially recommended by Redis for operating Redis for Java, while RedisTemplate is a high encapsulation of JedisApi in SpringDataRedis.
SpringDataRedis can easily replace the Java client of Redis compared to Jedis. It has more features of automatically managing connection pooling than Jedis, and is convenient to use with other Spring frameworks, such as: SpringCache


RedisTemplate is a template that uses redis in spring-data-redis.
JedisConnectionFactory is a factory class where spring-data-redis uses redis through jedis.

that is, spring is obtained by using redis through RedisTemplate and by jedis.


Jedis is an official encapsulation framework for Java operation redis-api by Redis.
redistemplate is the spring framework's encapsulation of jedis and lettuce. So that the spring framework system can be more convenient to access the functions of redis.

redistemplate supports jedis and lettuce

Menu