1. SDR description
Spring Data Redis (SDR), a set of simplified access to Redis APIs provided by Springframework, is another layer of encapsulation for Jedis.
The SDR integrates the four open-source Redis Connector of Jedis,jredis,srp,lettuce, all of which are open source Java libraries for Redis. Among them, Jredis and SRP start from spring-data-redis1.7, it is not supported.
2, Redistemplate description
Redistemplate is a core helper class for SDR, which is an advanced abstraction (another layer of encapsulation of Jedis) that encapsulates CRUD operations on data in Redis, including "Advanced encapsulation."
(1) Advanced package (recommended)
Advanced encapsulation operations include: Opsforvalue (), Opsforlist (), Opsforset (), Opsforzset (), Opsforhash (), and so on.
Description of Redistemplate in the official SDR document: The template is in fact the central class of the Redis module due to its rich feature set. The template offers a high-level abstraction for Redis interactions.
The redistemplate can call Valueoperations and listoperations, and so on, respectively, the advanced encapsulation of REDIS commands.
But Valueoperations and so on, these commands are eventually transformed into Rediscallback to execute. That is, by using rediscallback, you can achieve stronger functionality, the SDR document describes Rediscallback: Redistemplate and Stringredistemplate allow the developer to Talk directly to Redis through the Rediscallback interface. This gives all control to the developer as it talks directly to the redisconnection.
(2) Get the transition from the premium package to the lower package:
Redisoperations<string, object> operations = Opsforvalue.getoperations ();
3, Redisconnection provides a "low-level package."
(1) Low-level package
The low-level package operates directly on REDIS data by connecting to a Redis connection object.
The core of the low-level package is: Redistemplate.execute (new Rediscallback () {})
Resources
01. "Spring Data Redis Official document":
http://docs.spring.io/spring-data/redis/docs/1.7.2.RELEASE/reference/html/
"Original" Spring integrated Redis (first article)-SDR Brief