Latest web development tutorials

Redis Introduction

Redis is completely free open source, BSD comply with the agreement, it is a high-performance key-value database.

Redis with other key - value caching product has the following three features:

  • Redis supports data persistence, data can be kept in memory on disk, restart time can be loaded again for use.
  • Redis supports not only simple key-value data types, while also providing storage list, set, zset, hash and other data structures.
  • Redis supports backup of data, namely data backup master-slave mode.

Redis advantage

  • High performance - Redis can read speed is 110 000 times / s, write speed is 81000 times / s.
  • Rich data types - Redis support binary case Strings, Lists, Hashes, Sets and Ordered Sets data type of the operation.
  • Atom - Redis All operations are atomic, atomic while Redis also supports the implementation of the whole operation and after a few.
  • The rich feature set - Redis also supports publish / subscribe, notifications, key expiration and so on characteristics.

Redis different from other key-value store?

  • Redis has a more complex data structures and provide atomic operations on them, which is a different evolutionary path to another database. Meanwhile Redis data types are based on the basic data structure transparent to the programmer, without the need for additional abstraction.

  • Redis running in memory but can be persisted to disk, so the different data sets need to weigh speed read and write memory, the data should not be greater than the amount of hardware memory. Another advantage of in-memory databases is compared on the same disk of complex data structures, operate in memory it is very simple, so you can do a lot of internal Redis highly complex matter. Meanwhile, they are in terms of a compact disk format appending to produce, because they do not require random access.