Radis learning Summary

Source: Internet
Author: User

Comparison between redis and memcached.

1. memcached is multithreading, while redis uses a single thread.

2. memcached uses the pre-allocated memory pool. redis uses the on-site memory application method to store data and can configure virtual memory.

3. redis can achieve persistence, master-slave replication, and fault recovery.

4. memcached is a simple key and value, but redis supports many data types.

Redis currently provides five data types: String, list, hash, set, and zset (sorted set)

File concurrency (log processing): the solution is to first put data in the queue, and then start a thread to retrieve data from the queue and then write it to the file.

Redis master-slave replication: one master can have multiple slave instances, and one slave can have multiple slave instances. In this way, a powerful multi-level server cluster architecture is formed.

List <userinfo> List = new list <userinfo> () {New userinfo () {username = "Lisi", userpwd = "111"}, new userinfo () {username = "wangwu", userpwd = "123 "}};

Client. Set <list <userinfo> ("list", list );

List <userinfo> userinfolist = client. Get <list <userinfo> ("list ");

Foreach (userinfo in userinfolist)

{

Console. writeline (userinfo. username );

}

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.