Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to download redis

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you how to download redis, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's learn about it!

Redis download address: http://download.redis.io/releases/

Define

Redis is a key-value storage system. Similar to Memcached, it supports relatively more value types, including string (string), list (linked list), set (collection), zset (sorted set-ordered collection), and hash (hash type). These data types support push/pop, add/remove, and take intersection union and difference sets, and richer operations, and these operations are atomic. On this basis, redis supports a variety of different sorting methods. Like memcached, data is cached in memory for efficiency. The difference is that redis will periodically write updated data to disk or modify operations to additional record files, and on this basis to achieve master-slave (master-slave) synchronization.

Redis is a high-performance key-value database. The emergence of redis makes up for the deficiency of key/value storage such as memcached to a great extent, and can play a good complementary role to relational database in partial situations. It provides clients such as Java,C/C++,C#,PHP,JavaScript,Perl,Object-C,Python,Ruby,Erlang, which is easy to use.

Redis supports master-slave synchronization. Data can be synchronized from the master server to any number of slave servers, which can be the master server associated with other slave servers. This makes it possible for Redis to perform single-layer tree replication. Save the disk can intentionally or unintentionally write to the data. Because the publish / subscribe mechanism is fully implemented, when the slave database synchronizes the tree anywhere, it can subscribe to a channel and receive the complete message release record of the master server. Synchronization is helpful for scalability and data redundancy of read operations.

The official website address of redis, very easy to remember, is redis.io. (specially checked, the domain suffix io belongs to the national domain name, which is british Indian Ocean territory, that is, the British Indian Ocean Territory.)

Currently, Vmware is funding the development and maintenance of redis projects.

Common command

As far as DB is concerned, Redis has achieved amazing results, not to mention the likes of memcachedb and Tokyo Cabinet, and the original memcached seems to be only as fast as this level. Redis basically uses memory storage, and the key to persistence is these three instructions: SAVE BGSAVE LASTSAVE.

When the SAVE instruction is received, Redis will dump the data into a file.

What's worth mentioning is its exclusive function: storing lists and collections, which makes it more competitive with people like mc.

Do not introduce what is already in mc, only list the special ones:

TYPE key-the type used to get a key

KEYS pattern-matches all key that match the pattern, such as KEYS * lists all key, of course, complexity O (n)

RANDOMKEY-returns a random key

RENAME oldkeynewkey- key can also be renamed.

List operation, essence

RPUSH key string-adds a value to the end of a key list

LPUSH key string-add a value to the header of a key list

LLEN key-list length

LRANGE key start end-returns a range of values in the list, equivalent to a paging query in mysql

LTRIM key start end-retains only a range of values in the list

LINDEX key index-gets the value of a specific index number in the list, bearing in mind the O (n) complexity

LSET key index value-sets the value of a location in the list

LPOP key

RPOP key-like the LPOP above, it is a header and tail instruction similar to a stack or queue, and can be used as a message queue.

Set operation

SADD key member-add elements

SREM key member-Delete element

SCARD key-returns the collection size

SISMEMBER key member-determines whether a value is in the collection

SINTER key1 key2... KeyN-gets the intersection elements of multiple collections

SMEMBERS key-lists all elements of the collection

There is also the command of Multiple DB, you can replace db, data can be isolated, the default is stored in DB 0.

The above is how to download all the content of redis, thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

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.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report