"Original" Spring integrated Redis (first article)-SDR Brief

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.