1 What is Redis
Redis is a key-value storage system. Like memcached, it supports a relatively larger number of stored value types, including string (string), list (linked list), set (set), and Zset (ordered set). These data types support Push/pop, Add/remove and intersection-set and differential sets and richer operations, and these operations are atomic. On this basis, Redis supports a variety of different ways of ordering. As with memcached, data is cached in memory to ensure efficiency. The difference is that Redis periodically writes the updated data to the disk or writes the modification operation to the appended record file, and on this basis, it realizes the Master-slave (master-slave) synchronization.
2 How about the performance
Redis is a high-performance key-value memory database. Official Performance Test results: Set operation 110,000 times per second, get operation 81,000 times per second.
3 can save the object
Like memcached, it supports a relatively larger number of stored value types, including string (string), list (linked list), set (set), and Zset (ordered set). These data types support Push/pop, Add/remove, and intersection-set and difference sets and richer operations.
4 The biggest difference between Redis and memcache
Replication (tree-shaped)
Data types (String, Lists, Sorted Sets, hashes) persistence (snapshot, aof)
Many developers think that Redis can not be faster than memcached, memcached is completely based on memory, and Redis has persistent preservation features, even if asynchronous, Redis can not be faster than memcached. But the test result basically is Redis occupies the absolute advantage. Have been thinking about this reason, now think of the reasons for these aspects.
Libevent. Unlike memcached, Redis did not choose Libevent. Libevent's code is huge to cater to versatility (the current Redis code is less than Libevent 1/3) and sacrifices a lot of performance on a particular platform. Redis has implemented its own Epoll event loop (4) with the modification of two files in Libevent. Many developers in the industry also suggest Redis
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.