Introduction to Redis
Redis is completely open source and free, complies with the BSD protocol, and is a high-performance key-value database.
Redis and other key-value caching products have the following three characteristics:
Redis supports data persistence and can keep data in memory on disk. It can be loaded again for use when restarting.
Redis not only supports simple key-value type data, but also provides storage of data structures such as list, set, zset, and hash.
Redis supports data backup, that is, data backup in master-slave mode.
Advantages of Redis
Extremely high performance – Redis can read at a speed of 110,000 times/s and write at a speed of 81,000 times /s.
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.
#What is the difference between Redis and other key-value stores?
Redis has more complex data structures and provides atomic operations on them. This is an evolutionary path different from other databases. Redis's data types are based on basic data structures and are transparent to programmers, without the need for additional abstractions.
Redis runs in memory but can be persisted to disk, so memory needs to be weighed when performing high-speed reading and writing of different data sets. The amount of data should not be larger than the hardware memory. Another advantage over in-memory databases is that Compared with the same complex data structure on disk, it is very simple to operate in memory, so Redis can do many things with strong internal complexity. At the same time, in terms of disk format, they are compact and append-generated because they do not require random access.