Hacker News new | ask | show | jobs
by patio11 5663 days ago
An example from recent experience: if you want your application to have multiple cache stores, God help you. I use cache stores to wrap NoSQL stuff in a consistent API that I'm familiar with, and since sometimes I want stuff to be retained indefinitely and sometimes I just need a memcached scratchpad, I have multiple ones. That has gone fine... until it didn't, in a very catastrophic fashion.

What I really, really should have done was write a thin wrapper over the existing Redis code implementing the three methods I typically need my cache stores to support (read, write, fetch -- that's it), then configured the cache stores on class load from a YAML file. This would have gotten me done in an hour.

Instead I tried spelunking deep into the dark recesses of Rails 2.3.10, how it loads environments and initializers, and two gems to figure out what was going on... and very nearly had to postpone shipping because of it.

Don't do that.

But when I'm doing things the Rails Way, yeah, pretty much peaches and cream. I've never had an issue with writing arbitrarily complex Ruby code to do things that are not in the "typical web application" purview.