Posts tagged trick

Apr26

Rescue multiple exceptions in Ruby

ruby trick exceptions rescue | comments

Little Ruby trick that made my night:

module ApiError
  HttpExceptions = [
    RestClient::Exception,
    SystemCallError,
    SocketError,
    EOFError,
    Timeout::Error,
Continue reading »

Apr24

Zero downtime deploys for Rails apps - slides

rails database trick migrations | comments

Here are the slides for my talk on zero downtime deploys for Rails applications, presented at RailsConf 2012.

Really glad I had the opportunity to present here; hoping this will get people motivated to start thinking about the topic, and change the way we address the issues described there.

Continue reading »

Feb12

Hot compatibility beyond databases

rails database trick migrations | comments

Hot compatibility doesn't only apply to database migrations. Modern web applications can have a wide range of dependencies that without proper planning will break your deploy in subtle, unexpected ways.

Continue reading »

Jul13

Rails migrations with no downtime

rails database tricks migrations | comments

Lets understand the challenge of changing a Rails database without introducing any downtime with a simple, apparently harmless migration:

class ApparentlyHarmlessMigration < ActiveRecord::Migration
Continue reading »

Jun24

Managing a Rails app database with different branches

rails database tricks | comments

Relying on migrations to setup your Rails database when you have multiple branches is pretty hard. And slow. And blows away your data.

Instead I decided to simply have one database for each branch, defaulting to master. So this is my new database.yml:

Continue reading »