What's new in Redis 2.0?

Redis logo

Redis is currently one of my favorite databases. Why:

Redis 2.0 RC1 got released today and it offers lots of improvements. In this post I will highlight the ones I am excited about.

Redis now supports virtual memory

Redis 1.X requires that all the data is stored in memory and this has some limitations on larger data sets. Redis 2.0 supports virtual memory, which means that not all the data has to reside in physical memory! More info on Redis virtual memory support:

Transactions

MULTI, EXEC and DISCARD commands allow you to execute a group of Redis commands in a single step, while guaranteeing two things:

  • All the commands in a transaction are serialized and executed sequentially
  • Either all of the commands or none are processed

Read more about the MULTI command.

Hash data type

Redis 2.0 now has a Hash data type which makes it even easier to store objects in Redis. An example would be storing a user:

  • HSET user_1 nick_name amix: Set nick_name field of user_1 key
  • HSET user_1 age 25: Set age field of user_1 key
  • HGETALL user_1: Return all fields and values of user_1 key. Would return nick_name amix, age 25

A very important property of Redis Hashes is that they use very little memory for hashes composed of a small number of fields. For more info read more about Hashes on Redis's site.

Publish/subscribe support

With 2.0 you can easily build a scaleable publish/subscribe messaging platform. For more information check out PublishSubscribe document. antirez has also a great post on Redis pub/sub:

Try Redis online

You can play with Redis online at try.redis-db.com. It seems to run one of the newest versions of Redis (but not 2.0 yet).

Lots of extra commands and improvements

For more info check out the Redis 2.0 RC1 changelog, there's a lot of goodies.

Related:

1 comment so far

Looks promising, looking forward to it!

Post a comment
Commenting on this post has expired.
© 2000-2009 amix. Powered by Skeletonz.