Quick one today, but hopefully useful for others as it wasted a few hours of our time. At Salsify, we've been using Rake tasks to handle a few one-off data migrations. We ran into trouble, however, when the many logging statements we'd included didn't show up in our logs. We use PaperTrail but after some digging realized this applies to Heroku's base logging as well (at least on the Cedar stack).
By Jeremy Redburn on Jul 8, 2013 1:41:00 PM
By Dan Spangenberger on Jun 17, 2013 8:00:00 PM
One of the best things about Rails is how easy it is to interact with the database. Unfortunately, that's also one of the worst things about Rails if you care about performance (which you hopefully do). Inevitably, you'll find your application slowing down and track down the root cause to a recent change that spawned far more database queries than you expected, or hits the database when you least expected it.
Salsify is a single-page app (Backbone on the client, Rails + Postgres + Elastic Search on the backend) that requires very low latency responses to provide an interactive experience for browsing and editing product catalogs. In order to satisfy these latency requirements we rely heavily on Delayed Job for running time consuming tasks like importing data, exporting data, and applying bulk updates in background processes. We've found useful pattern for using Delayed Jobs callbacks and hooks together that I wanted to share.