Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Redis 2.2 Curbs its Memory Hunger

DZone's Guide to

Redis 2.2 Curbs its Memory Hunger

· Database Zone
Free Resource

Whether you work in SQL Server Management Studio or Visual Studio, Redgate tools integrate with your existing infrastructure, enabling you to align DevOps for your applications with DevOps for your SQL Server databases. Discover true Database DevOps, brought to you in partnership with Redgate.

While Redis 2.0 reaches RC2 status and prepares to be shipped in a few weeks, Redis creator Salvatore Sanfilippo is already deep into development on Redis 2.2.  In fact, the 2.2 version of this open source NoSQL is nearly complete from a features standpoint.  For a description of Redis, scroll down to the last paragraph.

Redis 2.0 and 2.2

Nearing the final release, Redis 2.0 contains a new AOF (Aggregate Objective Function) tool, a new testing suite, and "ridiculous speed improvements," said Sanfilippo.  Other new features in Redis 2.0 include VM optimization and Pub/Sub matching support.  In version 2.2, the focus is on increasing Redis' reliability, enhancing documentation, and reducing memory footprint.  There are several features that Sanfilippo wanted to add, such as stronger string type controls, MULTI/EXEC with CAS support, and a good clustering solution, but right now he's slowing down the process of adding new things.

Currently the Redis developers are working on facilitating DEL replication on expires in slaves and append only files.  This 2.2 feature will make it possible to perform write operations against expiring keys.  In addition to that, the developers have already made Redis 2.2 an order of magnitude less memory-hungry for aggregates.

Lowering the Memory Footprint

Sanfilippo and Peter Noordhuis together implemented some tricks for the Hash data type and reworked the top-level key->value dictionary to save memory.  Together, these changes greatly reduced the amount of memory used by Redis on several different types of datasets.  Those datasets include:

  • Many keys containing lists with an average length of 10, 100, 300, 500 elements
  • Many keys containing sets of integers with less than 1000 elements
  • Many keys containing hashes representing objects with 10, 20, 50 fields

As a result, one million keys, for example, with 500 elements list in each key costs 2GB, and one million keys with a Hash representing a user with name, surname, and 10 more random fields costs 300 MB on Redis 2.2.  There are also plans to enhance documentation and increase reliability in 2.2, but Sanfilippo hasn't mentioned any features in those areas just yet.

What is Redis?

Redis is a speedy, NoSQL key-value store with a rich API.  It's similar to memcached because values can be strings, but the dataset is not volatile.  Unlike memcached, Redis' values can also be lists, sets, hashmaps, blobs, and ordered sets.  It also allows you to append a value to the end of an item list that has already been stored for a given key.  All of its data types can be manipulated with atomic operations to push/pop elements, add/remove elements, perform server side union, intersection, difference between sets, and more.  The project's creator Salvatore Sanfilippo was hired by VMware this year, essentially putting the company's time and resources behind the open source project.

It’s easier than you think to extend DevOps practices to SQL Server with Redgate tools. Discover how to introduce true Database DevOps, brought to you in partnership with Redgate

Topics:

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}