News for hackers. Stuff that matters.
Re:Redis 2.2.0 RC1 is out by delano on Thursday December 16, 2010 @04:28AM (#2011562)
I use sorted sets quite heavily for timelines. And it's awesome.

One usecase I can't figure out, is storing/querying IP address ranges. Is there a natural way with Redis to check if a number is within a given range? (without storing every value and without multiple calls)

Re:Redis 2.2.0 RC1 is out by antirez on Thursday December 16, 2010 @08:02AM (#2011856)
There is a very easy way to model this, just convert the IP address into a 32bit integer! :) Then use ZRANGEBYSCORE to query.
Re:Redis 2.2.0 RC1 is out by delano on Thursday December 16, 2010 @09:47AM (#2012167)
What about the other way around though? Storing the range, say, 159.18.0.0 - 159.18.255.255, and then querying to check if an address is in that range.

The only way I can think to do this is to store the range as two integers, as you suggest, and query twice. The first to find the nearest lower bound for an IP and then a second time for the upper bound.