First of all, we must understand that redis is a database, redis is an in-memory database, all the data basically exists in memory, will be regularly appended or snapshots of the way to the hard disk refresh. Because redis is an in-memory database, so read and write speed is very fast, so it is often used to do data, page caching.
Redis common data types
Redis most commonly used data types are the following:
StringHashListSetSorted setpub/subTransactionsRedis practical application scenarios
Redis is different in many ways from other database solutions: it uses memory to provide primary storage support and only uses the hard disk for persistent storage; it has a very unique data model that uses a single thread. Another big difference is that you can use Redis features in your development environment without switching to Redis.
Switching to Redis is certainly desirable, and many developers use Redis as their database of choice from the start; but imagine if your development environment is already set up and your application is already running on it, then switching database frameworks is obviously not so easy. Also in some applications that require large datasets, Redis is not a good fit because its datasets don't exceed the memory available on the system. So if you have a big data application and it's mainly in read access mode, then Redis is not the right choice.
What I like about Redis, however, is that you can incorporate it into your system, which can solve a lot of problems, such as those tasks that your existing databases feel slow to handle. These you can then optimize with Redis or create some new functionality for the application. In this article, I'd like to explore how to incorporate Redis into an existing environment and utilize its native language commands and other features to solve some of the common problems encountered in traditional environments. In none of these examples is Redis the database of choice.
For more on Redis, visit the Redis Usage Tutorials section!