In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Redis from entry to Advanced level
Today, I would like to share with you some learning materials about Redis. I hope that through today's sharing, I will be able to lead you to a simple introduction to Redis.
First of all, what is Redis? Redis, whose full name is Remote Dictionary Server, is an open source caching middleware of Key-Value type. It can be used in a variety of scenarios such as database front-end caching, event publishing or subscription, high-speed queuing, and so on. Provides direct access to data types such as string (String), hash (Hash), list (List), collection structure (Set, Sorted Set), stream (Stream), etc. At the same time, it provides a way of reading based on memory, which can synchronize the data of memory to the disk. Redis is currently the most popular in-memory database. In AWS's largest public cloud vendor, MySQL ranks first in the database, while Redis ranks second. The database also has a popular ranking called DBEngines,DBEngines in which Redis ranks first in Kmurv storage and seventh in all databases. In addition, Redis is not limited to the Kmuri V domain. The following is a newly released picture in RedisConf:
In this picture, we can see that Redis can also be used as a text search, equivalent to Elasticsearch; can be used as a graph database; at the same time, it can be used as a document database, open source MongoDB; it can make achievements in the message field, equivalent to Kafka, it can provide the ability to provide streams type. In addition, at Redisconf in 2019, the Redis author demonstrated a real-time chat demo, which shows that Redis can bring in AI capabilities and can do machine learning. Greatly expand the boundaries of Redis, Redis is derived from Kmuri V, but far beyond Kmuri V.
Let's take a look at which users will use Redis. Basically, all large, medium and small distributed system applications will use Redis. Because cache is an important component in distributed system, it mainly solves the performance problem of hot data access in high concurrency and big data scenarios. The ability to provide high-performance fast data access.
Next, I will give you some examples of life. First of all, there is the example of Wechat grabbing red packets. Wechat grabs red packets is a very high-frequency operation. Let's think about the Spring Festival Gala, there are billions of Chinese click to grab red packets at the same time, which will bring a very large amount of traffic. If this traffic is directly pressed on the database, then basically the database will collapse directly, no doubt. However, if a Redis is added in front of the MySQL, more than 99% of the high-frequency traffic in the MySQL can be unloaded to the Redis. Then we only need to apply these two steps of operation: first, the application first goes to Redis to find out if there is still an amount of money in this red packet? At the same time, confirm that the number of people has reached the upper limit. If the conditions are met, the second confirmation operation of reading to the database is carried out. In this way, it will only transmit the effective traffic to the database, and intercept most of the data on the Redis side, thus achieving the role of protecting the MySQL database.
Another case is the shopping cart we encountered when we were selling Huawei mobile phones in Huawei Mall. We first used MySQL to choose which database to use in the shopping cart, because it is related to the customer's data. But in the actual use process, we find that the logic of the shopping cart is actually more, because it involves gifts, it involves the related discounts of items, so it involves more complex SQL operations. In this case, MySQL operations are prone to performance bottlenecks. Once upon a time, we had hackers who tried to test our shopping cart ability, just adding or decreasing the number of shopping carts automatically and brushing them concurrently all the time, we could destroy that database. We found this performance bottleneck in the process of optimization and unloaded the MySQL database into a Redis database. After using Redis, there are several effects. One is that it can unload non-critical traffic. On the other hand, we make use of the high-performance ability of Redis to turn some operations aimed at high frequency into a simple Kmuri V operation, which is actually of great help to the improvement of the efficiency of the whole system. In addition, Redis has applications in many products, for example, in the field of small videos, it can cache some user relationships; for example, the ranking of points in the game can use the ranking ability of Redis, and users who belong to Top can be displayed quickly; for example, in the booking system, you can use Redis to cache some user information. In this way, Redis basically does not have industry attributes, and can be entered into any distributed system and widely used.
The above briefly introduces the development and usage scenarios of Redis, and then there is an explanation and demonstration of Redis data structure, instance parameter configuration, backup recovery and migration and other operations. if you want to learn, sign up for the "introduction to Redis speeding" course of Huawei Cloud Institute (https://edu.huaweicloud.com/) immediately, and use seven days to quickly master Redis through the actual combat environment.
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.