News for hackers. Stuff that matters.
Re:Redis 2.6.0 Released by pjscott on Monday October 22, 2012 @09:04PM (#4686330)
Joy to all! This means that the Lua scripting is now available in a stable release!

Want to use Redis as a very fast bloom filter server? A couple of short Lua scripts can make it happen. Want to do some operation which would require a lot of round-trips to Redis? Turn it into a Lua script and get rid of those network round-trips. Once you get used to having this capability, it starts to feel indespensible, an essential feature that Redis would be incomplete without.

Oh, and I guess there are a bunch of other improvements in 2.6 -- reduced memory usage, more convenient command-line options for redis-server, some handy new commands, and a lot more -- but really, the Lua scripting is so good that it outshines everything else.

Re:Redis 2.6.0 Released by burke on Tuesday October 23, 2012 @12:33AM (#4686679)
That sounded like fun, so:

Bloom filters in redis: https://gist.github.com/3936629

Turns out it's kinda hard to get a decent hashing algorithm working in redis-lua-land, but I'm sure an implementation of murmurhash wouldn't be so hard if one had a few hours.

EDIT: It's worth mentioning, too, that we've been using a collection of lua scripts to manage inventory reservations at Shopify since March, and the tech has worked very well for us.

Re:Redis 2.6.0 Released by pjscott on Tuesday October 23, 2012 @02:33PM (#4689541)
I was thinking that you could have the client pass in a couple of hash values, and then use linear combinations of them to get a bunch of independent-enough hashes. This is mathematically fine, and hash functions are a dime a dozen when you're not in redis-lua-land. Paper justifying this technique:

http://www.eecs.harvard.edu/~michaelm/postscripts/tr-02-05.p...

Re:Redis 2.6.0 Released by aaronblohowiak on Monday October 22, 2012 @09:09PM (#4686340)
A little "self" promo: evalsha.com, a F/OSS repo of public domain Lua scripts for redis scripting. Please contribute your own scripts and pull requests are accepted for the site itself.
Re:Redis 2.6.0 Released by jws on Tuesday October 23, 2012 @09:48AM (#4688049)
14 entries so far, two of which are Viagra spam. The scum of the internet certainly are industrious.
Re:Redis 2.6.0 Released by pjungwir on Monday October 22, 2012 @11:10PM (#4686546)
The Lua scripting is also great if you need two commands to run atomically. I wrote a blog post about this just the other day:

http://illuminatedcomputing.com/posts/2012/10/redis-eval/

Re:Redis 2.6.0 Released by ecoffey on Tuesday October 23, 2012 @12:58AM (#4686729)
That's a great post! Thanks for sharing.

Not criticizing, but just curious: couldn't you have done this with "watch" and multi exec?

Re:Redis 2.6.0 Released by pjungwir on Tuesday October 23, 2012 @01:12AM (#4686756)
Honestly I barely knew about WATCH! But after reading through the docs, I don't think it would have worked in my case. I only had two keys: a list of pages to crawl, and a set of pages already crawled. WATCHing either key would have been too restrictive. Perhaps I could have approached it differently using lots of keys and GET/SET, but I like the simplicity of combining fewer keys with Redis's nice data structures.
Re:Redis 2.6.0 Released by aaronblohowiak on Tuesday October 23, 2012 @02:01AM (#4686836)
WME-style is optimistic, so you might have to retry over and over again to succeed. Lua scripts are queued up so you will make progress in the order you get in line. (Think spin lock vs queue)
Re:Redis 2.6.0 Released by pjscott on Tuesday October 23, 2012 @02:38PM (#4689580)
It also saves you a network round-trip and a surprising amount of code complexity.
Re:Redis 2.6.0 Released by ecoffey on Tuesday October 23, 2012 @11:06AM (#4688433)
Yes that is correct, thanks!
Re:Redis 2.6.0 Released by recuter on Monday October 22, 2012 @09:33PM (#4686380)
Indeed, and the next big thing I can't wait for is cluster which is coming in 3.0 I believe? Combined with the Lua support it makes possible some insanely great things.
Re:Redis 2.6.0 Released by bsg75 on Monday October 22, 2012 @10:46PM (#4686498)
> Want to use Redis as a very fast bloom filter server?

Yes! You should blog about this.

Re:Redis 2.6.0 Released by aaronblohowiak on Monday October 22, 2012 @09:07PM (#4686338)
Re:Redis 2.6.0 Released by jimktrains2 on Monday October 22, 2012 @09:22PM (#4686364)
Would you mind putting them into a single gist or git repo or would you mind if I do?
Re:Redis 2.6.0 Released by blutonium on Monday October 22, 2012 @10:43PM (#4686493)
Re:Redis 2.6.0 Released by aaronblohowiak on Monday October 22, 2012 @09:50PM (#4686422)
Please do.
Re:Redis 2.6.0 Released by jimktrains2 on Monday October 22, 2012 @08:58PM (#4686317)
Congratulations to antirez and all the other commiters! It's been a long awaited release and there are still a lot of good things to come!
Re:Redis 2.6.0 Released by antirez on Tuesday October 23, 2012 @04:26AM (#4687088)
Re:Redis 2.6.0 Released by didip on Tuesday October 23, 2012 @11:33AM (#4688559)
Can one simply upgrade from 2.4 -> 2.6? No data migration involved?

Side topic: It's pretty cool that you guys have dedicated pages for administration. http://redis.io/topics/admin

Re:Redis 2.6.0 Released by agildehaus on Wednesday October 24, 2012 @03:53AM (#4692037)
Read the release notes. There's an entire section about migration from 2.4 to 2.6.

Short answer: You can simply upgrade.

Re:Redis 2.6.0 Released by plasma on Tuesday October 23, 2012 @01:56AM (#4686828)
I can't tell, does 2.6 include Sentinel / failover support?
Re:Redis 2.6.0 Released by antirez on Tuesday October 23, 2012 @04:04AM (#4687036)
Both Redis 2.6 and latest 2.4 patch release are ready to be monitored by Sentinel as targets of the monitoring.

Redis 2.6 includes an experimental implementation of Sentinel considered in beta stage, that will be upgraded with every new release of 2.8.

The development of Redis Sentinel continues in the unstable branch in the meantime. Basically at some point when Sentinel will be declared stable, 2.6 will ship with a stable version of Sentinel, however 2.8 may implement additional support for Sentinel features that may not be available for 2.6.

Re:Redis 2.6.0 Released by aaronblohowiak on Tuesday October 23, 2012 @02:02AM (#4686837)
Yes. Sentinel is a mode of redis, and it will continue to improve in each 2.6 point-release.