Redis profile

  • 2020-05-27 07:31:17
  • OfStack

Redis web site is: http: / / www redis. io /.

Redis is an open source, advanced key-value store and an applicable solution for building high-performance, extensible Web applications.

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

a.Redis keeps its database entirely in memory, persisted only on disk.
b. Redis has a relatively rich set of data types compared to other key-value data stores.
c.Redis can copy data to any number of slaves.

The advantages of Redis

a. Extremely fast :Redis is very fast, performing approximately 110,000 setup (SET) operations per second, and approximately 81,000 read/fetch (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 it easy to use Redis to solve various problems, because we know which problems can be better used and which data types to handle.

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

d. Multi-utility :redis is a multi-utility that can be used for a variety of use cases, such as: caching, message queues (Redis locally supports publish/subscribe), any short-term data in the application, for example, sessions in the web application, page hit counts, etc.

Redis with other key value storage systems

a.Redis is a different evolutionary route for key-value database systems, whose values can contain more complex data types on which atomic operations can be defined.

b.Redis is an in-memory database, but is persistent on a disk database, so it represents a different trade-off, in which very high write and read speeds are achieved within the limits of a dataset that cannot be larger than memory (memory).

Another advantage of an in-memory database is that it is easier to manipulate the representation of complex data structures stored in memory than the same data structures on disk. As a result, Redis can do very little internal complexity.

Redis supports five data types


The string in Redis is a sequence of 1 byte. The strings in Redis are base 2 safe, which means that their length is not determined by any particular termination character. Therefore, you can store up to 512 megabytes of anything in a single string.


The Redis hash/hash (Hashes) is a collection of key-value pairs. The Redis hash/hash is a mapping between a string field and a string value. Therefore, they are used to represent objects.

The list of

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.

A collection of

The Redis collection is an unordered collection of strings. In Redis, you can add, delete, and test the O(1) complexity for the time a member exists.

Sortable set

The Redis sortable set is similar to the Redis set and is a set of non-repeating characters. The difference is that each member of the sorted set is associated with a score, which is used to sort the sorted set from the smallest score to the largest score. Although the member is unique to one, the score value can be repeated.

Related articles: