A: Introduction to Redis
Redis is fully open source free, adheres to the BSD protocol and is a high-performance Key-value database.
Redis and other Key-value cache products have the following three features:
- Redis supports data persistence, which saves data in memory on disk and can be loaded again for use when restarting.
- Redis not only supports simple key-value types of data, but also provides storage of data structures such as List,set,zset,hash.
- Redis supports backup of data, that is, Master-slave mode of data backup.
Two: Redis Advantage
- The performance is very high –redis can read the speed is 110,000 times/s, the write speed is 81,000 times/s.
- Rich data types –redis support binary case Strings, Lists, hashes, sets and Ordered sets data type operations.
- All atomic –redis operations are atomic, and Redis supports atomic execution of several operations.
- Rich features –redis also supports publish/subscribe, notifications, key expiration, and more.
Three: What is the difference between Redis and other Key-value storage?
Redis has more complex data structures and provides atomic manipulation of them, which is a different evolutionary path from other databases. The data types of Redis are based on basic data structures and are transparent to programmers without the need for additional abstraction.
Redis runs in memory but can be persisted to disk, so it is necessary to weigh the memory when writing to different datasets at high speed because the amount of data cannot be larger than the hardware memory. Another advantage of the in-memory database is that it is very simple to operate in memory compared to the same complex data structure on disk, so Redis can do a lot of things that are internally complex. At the same time, they are compact in the form of disks, because they do not have to be randomly accessed.
Cache Database-redis Introduction