Redisson client introduction and advantages and disadvantages

Source: Internet
Author: User

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.

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.