📜 ⬆️ ⬇️

Redis 2.0

September 3, 2010 Redis 2.0 unnoticed. There are many interesting features. Some of them expand the boundaries of advanced key-value storage to queuing and more. Translation of the list of new features from the Redis website:

Redis 2.0 release is the main stage in the development of Redis. Apart from the endless list of new features, there are several major ones that deserve special mention.

It is worth mentioning that Redis 2.0 has just reached its first stable release, Redis 2.2 is close to freezing new features, so be prepared for new delightful pieces soon!

The MULTI / EXEC command family was added to fill the need to execute several commands as one atomic unit (from the translator: in general, this is an analogue of transactions in ordinary databases). Because all the commands inside the MULTI / EXEC block are serialized and executed sequentially, it is impossible for another client request to be executed in the middle of the execution of this block. All commands are executed one after another when EXEC is called. This ensures that either all commands are executed, or none, regardless of the connection status with the client.

More about MULTI / EXEC:
Note that the WATCH, CAS (check and set) MULTI / EXEC version will be available in 2.2.0 and is not part of 2.0.0.

Blocking pop

The BLPOP and BRPOP commands have been added to allow selection from the list with blocking. This means that the connection with the client will be blocked for a certain time until another client adds an item to the list. These commands are often used in a producer / consumer scenario.

More about blocking pop:

Publish / Subscribe

The publish / subscribe command family allows the client to post messages to the feed and subscribe to receive all posts that are posted to the feeds. It also includes commands that allow you to receive all messages for which the channel corresponds to a given pattern.

Read more about posting / subscribing:


This is a new data type that allows you to save multiple keys / values ​​in one key. Along with a list of regular teams you would expect for this type (HSET, HGET, HDEL, HLEN, HKEYS, ...). It is also possible to use the values ​​inside the hash for any SORT operations.

More about hashes:

Virtual memory

Redis Virtual Memory allows users to grow their data set beyond their memory.

More on virtual memory:

Original article: code.google.com/p/redis/wiki/Redis_2_0_0_Changelog

Source: https://habr.com/ru/post/105022/

All Articles