In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the meaning of redis philosophy Sanlian, which is very detailed and has a certain reference value. Friends who are interested must read it!
The third company of redis philosophy is that during the interview, the examiner asked three questions about redis: "what is it? why? how to use it?" .
These three questions need to have a deep understanding of redis, and the examiner does not want to hear all the answers online, but also pay attention to your own understanding.
Redis is an open source API that is written in ANSI C language, supports the network, can be memory-based and persistent, and provides API in multiple languages.
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.
1. Cache of hot spot data
Because redis accesses speed blocks and supports a wide range of data types, redis is very suitable for storing hot data. In addition, combined with expire, we can set the expiration time and then update the cache. This function is the most common, and almost all of our projects have been used.
2. The application of time-limited business
In redis, you can use the expire command to set the lifetime of a key, and redis will delete it when the time expires. This feature can be used in time-limited preferential activity information, mobile phone CAPTCHA and other business scenarios.
3. Counter related problems
Redis incrby command can be used to increase atomicity, so it can be used in highly concurrent flash sale activity, distributed serial number generation, and specific business, such as limiting the number of SMS messages sent by a mobile phone number, the number of requests per minute, the number of calls per day, and so on.
4. Issues related to the ranking
The query speed of relational database is generally slow in terms of ranking, so we can sort hot data with the help of redis's SortedSet.
5. Distributed lock
Of course, we can apply this feature to other scenarios that require distributed locks, and the main purpose of combining expiration time is to prevent deadlocks.
6. Delay operation
7. Paging and fuzzy search
The above is all the contents of what the third company of redis philosophy means. Thank you for your reading! Hope to share the content to help you, more related 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.
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.