Redis introduction

Time:2019-10-6

The official Redis website is http://www.redis.io/.

Redis is an open source, high-level key storage and an applicable solution for building high-performance, scalable Web applications.

Redis has three main features that make it superior to other key data storage systems:

Redis keeps its database in full memory and uses only disk for persistence.
B. Redis has a relatively rich set of data types compared with other key data storage.
C. Redis can copy data to any number of slaves.

Advantages of Redis

A. Exceptionally fast: Redis is very fast. It can perform about 110,000 SET operations per second and about 81,000 GET operations per second.

B. Support rich data types: Redis supports most of the data types commonly used by developers, such as lists, collections, sorted sets, hashes, and so on. This makes Redis easy to use to solve problems, because we know which problems can be better used and which data types can be handled.

C. Operations are atomic – all Redis operations are atomic, which ensures that if two clients access concurrently, the Redis server can receive updated values.

D. Multi-Utilities: redis is a multi-utility that can be used for many use cases, such as caching, message queuing (Redis locally supports publish/subscribe), any short-term data in an application, such as sessions in a web application, page hit counts, etc.

Redis and other key value storage systems

Redis is a different evolutionary route of key-valued database systems. Its values can contain more complex data types on which atomic operations can be defined.

B. Redis is a memory database, but it is persistent on disk database, so it represents a different trade-off. In this case, it can achieve very high write and read speed under the limitation of data sets that cannot be larger than memory.

C. Another advantage of the main memory database is that it is easier to store and represent complex data structures in memory than the same data structures on disk. Therefore, Redis can do very little internal complexity.

Redis supports five data types

Character string

The string in Redis is a sequence of bytes. Strings in Redis are binary-safe, meaning that their length is not determined by any particular termination character. Therefore, anything up to 512 megabytes can be stored in a string.

Hash/hash

Redis hashes are sets of key-value pairs. Redis hash/hash is a mapping between string fields and string values. Therefore, they are used to represent objects.

list

The Redis list is just a list of strings, sorted in insertion order. You can add elements to the head or tail of the Redis list.

aggregate

The Redis set is an unordered set of strings. In Redis, you can add, delete, and test the time O (1) complexity of members.

Sortable set

Redis sortable sets are similar to Redis sets and are non-repetitive character sets. The difference is that each member of the sorted set is associated with a fraction, which is used to sort the sorted set by the smallest fraction to the largest fraction. Although members are unique, scores can be repeated.

Above is Editor’s introduction to you. I hope it will be helpful to you. If you have any questions, please leave me a message. Editor will reply to you in time. Thank you very much for your support to developpaer.