Model Object Caching

At a recent meetup I was explaining the benefits of caching model objects and how it can help performance by reducing calls to your database. I was only able to give contrived examples at the time but I thought that since I recently had a use case that fell into this neighborhood I thought I’d share. I’ll note that Rails will, by default, write to the file system but for optimal performance you’ll want to use a memory based store like memcached or redis.

Continue reading »

SQL Old School Part 2

Here is the second SQL example that took me more googling than it should have so I thought I’d also post about it. Lets assume we have a SQL table with employee bonuses in it. We know how easy it is to find the highest bonus.

Continue reading »