Settings

Theme

Using Redis with Ruby on Rails

jimneath.org

81 points by Jim_Neath 15 years ago · 11 comments

Reader

andrewvc 15 years ago

I actually like the redis-objects gem, which maps redis structures to ruby objects.

https://github.com/nateware/redis-objects

  • michaeldhopkins 15 years ago

    Would you please explain why you prefer it to rb-redis?

    • andrewvc 15 years ago

      redis-rb maps redis commands into the ruby namespace.

      redis-objects is built on top of redis-rb and creates objects that are backed by redis, with operations like push, pop, etc. cleanly mapped.

      In other words, it's a more ruby-like API.

      I recommend reading the github README for redis-objects, it goes into a lot of depth.

      • dasil003 15 years ago

        The critical distinction of redis-objects is that it does not abstract away the atomic redis commands, which are the source of redis' power. It contrasts with ORMs where the goal is primarily convenience; with redis-objects the goal is power.

  • Jim_NeathOP 15 years ago

    I've never used redis-objects but it does look interesting. I'll have a play around with it tonight and update the post.

    Thanks for the heads up.

    Edit: updated.

caiusdurling 15 years ago

Nice intro piece. Especially liked the breakdown of data structures in redis, comparing them to Ruby.

igorgue 15 years ago

I really loved the "TL;DR: Redis is fucking awesome."

I started using Redis for a project with Node, and I loved the node_redis library because it's non-blocking :-)

  • koudelka 15 years ago

    I'm working on bringing em-hiredis up to spec. If you want a similarly non-blocking ruby alternative. https://github.com/koudelka/em-hiredis

  • tptacek 15 years ago

    Redis is absolutely beautiful for async networking; the protocol is extremely straightforward. It has completely solved my problem of persisting data from EventMachine programs in Ruby, too.

    A couple hundred lines of ObjC got a generic Redis client and a special-purpose blpop client working for my Cocoa apps (I keep libevent in a thread there).

phlux 15 years ago

I would love to see performance info for a site running redis on top of FusionIO hardware.

  • pjscott 15 years ago

    Redis' usual mode of operation is to keep the dataset in memory, making the FusionIO SSD hardware kind of redundant. With the new diskstore back-end, though, and really fast solid state drives, I bet that Redis could be really fast with a data set much bigger than memory.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection