Since redisson was an open-source Project released in December January 2014, it is still a new thing for many users who use redis. The redisson documentation has a brief introduction in addition to github, other websites are not yet available, so I have a github introduction based on my understanding of the source code and a brief introduction to redisson. Redisson implements a distributed and scalable java data structure that supports the following data structures: List, Set, Map, Queue, SortedSet, ConcureentMap, Lock, AtomicLong, CountDownLatch. It is thread-safe, and the underlying layer uses Netty 4 for network communication. Compared with jedis, it has simple functions and does not support redis features such as sorting, transactions, pipelines, and partitions. It can be considered as a supplement to jedis and cannot be replaced with jedis. Advantages: 1. You can use a familiar java data structure. For example, if you want to store 1, 2, 3, 4 in the List, the Code is as follows:
List<Integer> list = redisson.getList("list");list.add(1);list.add(2);list.add(3);list.add(4);
List<TestObject> list = redisson.getList("list");list.add(new TestObject());
public V set(int index, V element) { checkIndex(index); RedisConnection<String, Object> conn = connectionManager.connection(); try { while (true) { conn.watch(getName()); V prev = (V) conn.lindex(getName(), index); conn.multi(); conn.lset(getName(), index, element); if (conn.exec().size() == 1) { return prev; } } } finally { connectionManager.release(conn); } }
String storage is not supported. The Redisson implementation class only supports set operations and does not support common characters. It does not support many redis features, such as sorting, transactions, pipelines, and clusters. The release time is short, and the stability and reliability need to be verified.