We try to keep our stack pretty simple at Central.ly. We are a small team, and we’d rather be talking to customers than managing a bunch of independent, dedicated services. Rails + Postgres on Heroku, nice and easy. But for Redis, we made an exception.
Redis snuck into our lives through the fantastic Resque gem. Queue up a Rails job you want done in the background, and Resque will take care of it. But a little tinkering led to some interesting new thoughts. Redis is extremely light weight, with a very simple query interface, and we started using it like a fluffier, friendlier version of a database. Instead of treating it like a standard DB workhorse, making sure everything is safe and secure at all times, we use our Redis to Go instance more like a scratch pad, jotting down things we want to remember and saving extra pieces of data for later. Got a selection of customer comments you want to keep together to reference later? Stick it in Redis! Need to store some sales calculations that are going to be irrelevant next week? Stuff it in ol’ Redis! Saving some daily reports for the next few weeks? Give ‘em to R-dizzle!
If Postgres is like your web app’s spouse (and sometimes it feels more like your boss) then Redis is more like your younger, cooler cousin who comes in town and makes you have fun, even if you’re not in the mood. And for that, Redis, we love you.
Some of this easiness comes from the simplicity of a fast, schemaless database. No migrations, no indexes, no query plans. But a lot of it comes from the fact that Redis is *not* our primary database. Because it is something stuck on, and something that’s naturally limiting in its lack of a relational model, we treat it like a bonus database, something we can bang on, screw up, and if something goes wrong it’s not that big a deal. If Postgres if like your web app’s spouse (and sometimes it feels more like your boss) then Redis is more like your younger, cooler cousin who comes in town and makes you have fun, even if you’re not in the mood. And for that, Redis, we love you.