In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
How many data structures does Redis have? I believe that many people have a half-understanding of Redis 'five data structures. Xiaobian summarizes the following contents for everyone. The following information is about the contents of Redis's five data structures.
Redis is a high-performance key-value database. The emergence of redis largely compensates for the lack of key/value storage such as memcached, and can complement relational databases in some cases. It provides Java, C/C++, C#, PHP, JavaScript, Perl, Object-C, Python, Ruby, Erlang and other clients, very convenient to use.
The rise of redis is no accident, it does have its own new things in it, it is not like Memcached, can only store data in memory, it provides persistence mechanism and data synchronization, to avoid the avalanche problem after the outage, that is, after the server has problems, all the original data retained in memory is lost, and the data needs to be reorganized into memory. At this time, Memcached will go through a very slow process.
Redis support persistence is just one of its weapons. In addition, Redis also provides up to 5 data storage methods for different needs to achieve your needs with maximum efficiency. Here are a few data types:
a string (character string)
string is the simplest type, you can understand it as the same type as Memcached, a key corresponds to a value, and the operations supported on it are similar to Memcached. But it's more functional.
Two lists (doubly linked list)
A list is a linked list structure whose main function is to push, pop, get all the values of a range, and so on. It is bidirectional because it can operate on the left and right sides of the linked list respectively.
3 dict(hash table)
Set is a set, similar to the concept of set in mathematics. There are operations on the set, such as adding and deleting elements, and finding the intersection and difference of multiple sets. Key is understood as the name of the collection in the operation
4 zset(sort set)
Zset is an upgraded version of set, adding an order attribute to set. This attribute can be specified when adding and modifying elements. After each specification, zset will automatically adjust the order according to the new value. You can set the sorting weight for the specified key value, which applies more ranking modules.
5 Types of Hash
Redis can store key pairs of multiple attribute data (such as user1.uname user1.passwd), of course, you can complete these attributes in json format, directly as a string type to operate, but this performance is on the impact, so redis proposed Hash type.
After reading the above, do you know about the five data structures of Redis? If you want to know more about related articles, welcome to pay attention to the industry information channel, thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.