

Adding Interval Sets to Redis - justinmares
http://blog.togo.io/how-to/adding-interval-sets-to-redis/

======
joevandyk
For what it's worth, postgresql supports intervals (ranges) as of 9.1.
[http://www.postgresql.org/docs/9.2/static/rangetypes.html](http://www.postgresql.org/docs/9.2/static/rangetypes.html)

There's also a fantastic ip4r extension for postgresql that lets you
efficiently query IP ranges (which the article says was the motivation for
adding interval sets to redis).

I use it for storing maxmind's IP database to figure out where our visitors
come from in SQL queries -- given an IP address, I can find the city. zip
code, lat/lon, etc. Which lets me easily figure out things like "what
percentage of our users that purchased something this year are in this
particular UPS shipping zone?"

------
mmastrac
This is a dupe of a post a long time ago, but if you haven't read it, it's a
great read and shows how well-architected Redis is.

~~~
hox
Original thread:
[http://news.ycombinator.com/item?id=5663727](http://news.ycombinator.com/item?id=5663727)

