1.What is Redis?
Generally speaking, there are several current database classifications, including SQL/NSQL, relational database, key-value database, etc. The classification standards are not the same. Redis is essentially a key-value database. , but while maintaining the simple and fast characteristics of the key-value database, it also absorbs some of the advantages of the relational database. Thus its position is between relational database and key-value database. Redis can not only save Strings type data, but also Lists type (ordered) and Sets type (unordered) data, and can also complete advanced functions such as sorting (SORT). When implementing INCR, SETNX and other functions, It ensures the atomicity of its operations. In addition, it also supports master-slave replication and other functions.
2. What is used for using Redis?
Generally speaking of limitations, Redis also exists in the form of a message queue and as an embedded List to meet real-time high concurrency requirements. Usually in an e-commerce type data processing process, queues of related products, hot sales, and recommended sorting are usually stored in Redis, and the reading and updating of Redis lists by Storm are also included in the process. 3.Advantages of Redis
Extremely high performance – Redis can support more than 100K read and write frequencies per second. Rich data types – Redis supports Strings, Lists, Hashes, Sets and Ordered Sets data type operations for binary cases. Atomic - All operations of Redis are atomic, and Redis also supports atomic execution of several operations after they are fully merged. Rich features – Redis also supports publish/subscribe, notifications, key expiration and other features. 4.The shortcoming of Redis
is that the database capacity is limited by physical memory and cannot be used for high-performance reading and writing of massive data. Therefore, the main limitations of Redis are suitable for scenarios High-performance operations and calculations on smaller amounts of data. Summary: Redis is limited to specific scenarios, focuses on specific fields, and is quite fast. There is currently no alternative product.For more Redis-related technical articles, please visit the Redis Tutorial column to learn!
The above is the detailed content of What is redis mainly used for?. For more information, please follow other related articles on the PHP Chinese website!