Three frames of Redis: Jedis, Redisson, Lettuce Jedis the selection of comparison with Redisson

 

Jedis api online at: http: //tool.oschina.net/uploads/apidocs/redis/clients/jedis/Jedis.html

redisson official website address: https: //redisson.org/

redisson git Project address: https: //github.com/redisson/redisson

lettuce official website address: https: //lettuce.io/

lettuce git Project address: https: //github.com/lettuce-io/lettuce-core

 

concept:

  Jedis: Redis is a Java implementation of the client, providing more comprehensive support for Redis commands,

  Redisson: a distributed and scalable Java data structures.

  Lettuce: Advanced Redis Client for thread-safe synchronous, asynchronous and response used to support cluster, Sentinel, pipes and encoders.

advantage:

  Jedis: it provides a more comprehensive operational characteristics of Redis

  Redisson: separation of concerns prompting the user to Redis provides many distributed service-related operations, for example, distributed lock, distributed collection can be delayed by Redis support queue

  Lettuce: mainly used more in some distributed caching framework

adjustable:

Jedis: use blocking I / O, and call its methods are synchronized, the program flow need to wait until sockets finished with I / O to perform, does not support asynchronous. Jedis client instance is not thread safe, so it is necessary to use the Jedis through a connection pool.

Redisson: frame-based communication layer Netty event driven, which method calls are asynchronous. Redisson the API is thread safe, it is possible to operate a single connection to complete the various operations Redisson

Lettuce: frame-based communication layer Netty event driven, which method calls are asynchronous. Lettuce The API is thread safe, it is possible to operate a single connection to complete the various operations Lettuce

 

in conclusion:

Recommended: Jedis + Redisson

 

Jedis compared with Redisson Selection

 

1 Overview

1.1. The main contents

The main content of this article is the comparison of two frames of Redis: Jedis and Redisson, analyze their strengths and weaknesses, providing a reference project, select Java caching scheme to Redis programming model.

2.     Jedis and Redisson contrast

2.1     Overview comparison

Jedis is a Java implementation of the client Redis, the API provides more comprehensive support for Redis commands; Redisson a distributed and scalable Java data structures, and Jedis compared to function relatively simple, does not support string manipulation, Redis properties do not support ordering, transaction, plumbing, zoning and so on. Redisson aim is to promote the separation of interest to the user Redis, thereby enabling users to focus more narrowly on business logic.

2.2.     Programming Model

The Jedis method calls are relatively low-level exposure of the Redis API, namely Jedis in Java and basic methods of Redis API maintains consistent understanding of Redis API, it will also be able to skillfully use Jedis. The method Redisson in the abstract is relatively high, each method call may have been one or more Redis method call.

The following are examples of simple and Redisson Jedis operations:

Jedis key-value is provided and set operations:

Jedis jedis = …;

jedis.set("key", "value");

List<String> values = jedis.mget("key", "key2", "key3");

Redisson operation map:

Redisson redisson = …

RMap map = redisson.getMap("my-map"); // implement java.util.Map

map.put("key", "value");

map.containsKey("key");

map.get("key");

2.3.     Scalability

Jedis use blocking I / O, and call its methods are synchronized, the program flow need to wait until sockets finished with I / O to perform, does not support asynchronous. Jedis client instance is not thread safe, so it is necessary to use the Jedis through a connection pool.

Redisson use non-blocking I / O and communication layer based Netty event-driven framework, which method calls are asynchronous. The API is Redisson thread-safe, can be connected to operate a single Redisson complete the various operations.

2.4     Data Structure

Jedis supports only basic data types such as: String, Hash, List, Set, Sorted Set.

Redisson not only provides a series of commonly used Java distributed objects, which can be common with the basic data structure Java also provides a number of distributed services, including (BitSet, Set, Multimap, SortedSet, Map, List, Queue, BlockingQueue, deque, BlockingDeque, Semaphore, Lock, AtomicLong, CountDownLatch, Publish / Subscribe, Bloom filter, Remote service, Spring cache, Executor service, Live Object service, Scheduler service).

In a distributed development, Redisson can provide a more convenient way.

2.5.     Third Party Integration Framework

1 Redisson objects and provides all the services and features of the Spring framework similar to the way namespaces Spring XML configuration RedissonClient instance and it supports;

2 Redisson complete Spring framework to achieve a caching mechanism;

3 Redisson implements the Java cache standards on the basis of Redis;

4 Redisson provides for the Apache Tomcat cluster-based, non-sticky Redis session management functions. This feature supports Apache Tomcat version 6, 7 and 8.

5 Redisson also provides an implementation of Spring Session Session Manager.

 

Jedis api online at: http: //tool.oschina.net/uploads/apidocs/redis/clients/jedis/Jedis.html

redisson official website address: https: //redisson.org/

redisson git Project address: https: //github.com/redisson/redisson

lettuce official website address: https: //lettuce.io/

lettuce git Project address: https: //github.com/lettuce-io/lettuce-core

 

concept:

  Jedis: Redis is a Java implementation of the client, providing more comprehensive support for Redis commands,

  Redisson: a distributed and scalable Java data structures.

  Lettuce: Advanced Redis Client for thread-safe synchronous, asynchronous and response used to support cluster, Sentinel, pipes and encoders.

advantage:

  Jedis: it provides a more comprehensive operational characteristics of Redis

  Redisson: separation of concerns prompting the user to Redis provides many distributed service-related operations, for example, distributed lock, distributed collection can be delayed by Redis support queue

  Lettuce: mainly used more in some distributed caching framework

adjustable:

Jedis: use blocking I / O, and call its methods are synchronized, the program flow need to wait until sockets finished with I / O to perform, does not support asynchronous. Jedis client instance is not thread safe, so it is necessary to use the Jedis through a connection pool.

Redisson: frame-based communication layer Netty event driven, which method calls are asynchronous. Redisson the API is thread safe, it is possible to operate a single connection to complete the various operations Redisson

Lettuce: frame-based communication layer Netty event driven, which method calls are asynchronous. Lettuce The API is thread safe, it is possible to operate a single connection to complete the various operations Lettuce

 

in conclusion:

Recommended: Jedis + Redisson

 

Jedis compared with Redisson Selection

 

1 Overview

1.1. The main contents

The main content of this article is the comparison of two frames of Redis: Jedis and Redisson, analyze their strengths and weaknesses, providing a reference project, select Java caching scheme to Redis programming model.

2.     Jedis and Redisson contrast

2.1     Overview comparison

Jedis is a Java implementation of the client Redis, the API provides more comprehensive support for Redis commands; Redisson a distributed and scalable Java data structures, and Jedis compared to function relatively simple, does not support string manipulation, Redis properties do not support ordering, transaction, plumbing, zoning and so on. Redisson aim is to promote the separation of interest to the user Redis, thereby enabling users to focus more narrowly on business logic.

2.2.     Programming Model

The Jedis method calls are relatively low-level exposure of the Redis API, namely Jedis in Java and basic methods of Redis API maintains consistent understanding of Redis API, it will also be able to skillfully use Jedis. The method Redisson in the abstract is relatively high, each method call may have been one or more Redis method call.

The following are examples of simple and Redisson Jedis operations:

Jedis key-value is provided and set operations:

Jedis jedis = …;

jedis.set("key", "value");

List<String> values = jedis.mget("key", "key2", "key3");

Redisson operation map:

Redisson redisson = …

RMap map = redisson.getMap("my-map"); // implement java.util.Map

map.put("key", "value");

map.containsKey("key");

map.get("key");

2.3.     Scalability

Jedis use blocking I / O, and call its methods are synchronized, the program flow need to wait until sockets finished with I / O to perform, does not support asynchronous. Jedis client instance is not thread safe, so it is necessary to use the Jedis through a connection pool.

Redisson use non-blocking I / O and communication layer based Netty event-driven framework, which method calls are asynchronous. The API is Redisson thread-safe, can be connected to operate a single Redisson complete the various operations.

2.4     Data Structure

Jedis supports only basic data types such as: String, Hash, List, Set, Sorted Set.

Redisson not only provides a series of commonly used Java distributed objects, which can be common with the basic data structure Java also provides a number of distributed services, including (BitSet, Set, Multimap, SortedSet, Map, List, Queue, BlockingQueue, deque, BlockingDeque, Semaphore, Lock, AtomicLong, CountDownLatch, Publish / Subscribe, Bloom filter, Remote service, Spring cache, Executor service, Live Object service, Scheduler service).

In a distributed development, Redisson can provide a more convenient way.

2.5.     Third Party Integration Framework

1 Redisson objects and provides all the services and features of the Spring framework similar to the way namespaces Spring XML configuration RedissonClient instance and it supports;

2 Redisson complete Spring framework to achieve a caching mechanism;

3 Redisson implements the Java cache standards on the basis of Redis;

4 Redisson provides for the Apache Tomcat cluster-based, non-sticky Redis session management functions. This feature supports Apache Tomcat version 6, 7 and 8.

5 Redisson also provides an implementation of Spring Session Session Manager.

 

1 Overview

1.1. The main contents

The main content of this article is the comparison of two frames of Redis: Jedis and Redisson, analyze their strengths and weaknesses, providing a reference project, select Java caching scheme to Redis programming model.

2.     Jedis and Redisson contrast

2.1     Overview comparison

Jedis is a Java implementation of the client Redis, the API provides more comprehensive support for Redis commands; Redisson a distributed and scalable Java data structures, and Jedis compared to function relatively simple, does not support string manipulation, Redis properties do not support ordering, transaction, plumbing, zoning and so on. Redisson aim is to promote the separation of interest to the user Redis, thereby enabling users to focus more narrowly on business logic.

2.2.     Programming Model

The Jedis method calls are relatively low-level exposure of the Redis API, namely Jedis in Java and basic methods of Redis API maintains consistent understanding of Redis API, it will also be able to skillfully use Jedis. The method Redisson in the abstract is relatively high, each method call may have been one or more Redis method call.

The following are examples of simple and Redisson Jedis operations:

Jedis key-value is provided and set operations:

Jedis jedis = …;

jedis.set("key", "value");

List<String> values = jedis.mget("key", "key2", "key3");

Redisson operation map:

Redisson redisson = …

RMap map = redisson.getMap("my-map"); // implement java.util.Map

map.put("key", "value");

map.containsKey("key");

map.get("key");

2.3.     Scalability

Jedis use blocking I / O, and call its methods are synchronized, the program flow need to wait until sockets finished with I / O to perform, does not support asynchronous. Jedis client instance is not thread safe, so it is necessary to use the Jedis through a connection pool.

Redisson use non-blocking I / O and communication layer based Netty event-driven framework, which method calls are asynchronous. The API is Redisson thread-safe, can be connected to operate a single Redisson complete the various operations.

2.4     Data Structure

Jedis supports only basic data types such as: String, Hash, List, Set, Sorted Set.

Redisson not only provides a series of commonly used Java distributed objects, which can be common with the basic data structure Java also provides a number of distributed services, including (BitSet, Set, Multimap, SortedSet, Map, List, Queue, BlockingQueue, deque, BlockingDeque, Semaphore, Lock, AtomicLong, CountDownLatch, Publish / Subscribe, Bloom filter, Remote service, Spring cache, Executor service, Live Object service, Scheduler service).

In a distributed development, Redisson can provide a more convenient way.

2.5.     Third Party Integration Framework

1 Redisson objects and provides all the services and features of the Spring framework similar to the way namespaces Spring XML configuration RedissonClient instance and it supports;

2 Redisson complete Spring framework to achieve a caching mechanism;

3 Redisson implements the Java cache standards on the basis of Redis;

4 Redisson provides for the Apache Tomcat cluster-based, non-sticky Redis session management functions. This feature supports Apache Tomcat version 6, 7 and 8.

5 Redisson also provides an implementation of Spring Session Session Manager.

Guess you like

Origin www.cnblogs.com/williamjie/p/11287292.html