Description: The content may be a bit old and need to be weighed on the business.
There are two implementations of Redis's clients, one can call Jedis directly, and the other is to use Spring Data Redis, which can be called through Spring's encapsulation. Which one should I use? Based on the current version of Spring Data Redis 1.0.1 and Jedis 2.0.0, the analysis is as follows:
Spring Data Redis 1.0.1 Benefits
1, the specific Redis client has been encapsulated, the client can be in the JEDIS,JREDIS,RJC and other Java clients to make choices and switch.
2, using template to do the call encapsulation, eliminating the establishment of connection, release connection and other cumbersome code.
3. The serialization of objects is also free to select tools.
4. Provide support for spring cache, use annotations to implement cache, but cannot set cache expiration time.
Jedis 2.0.0 Advantages
1, can be used to Jedis itself to provide more features, such as sharded, such as Masater/slaver.
Reference:
http://sailorls.iteye.com/blog/1604702 (the above content is transferred from this article)
Spring Data Redis vs. Jedis selection (RPM)