Wednesday 18 June 2014

Rails migrations for zero-downtime sites

At TuShare we have a zero-downtime site with continuous deployment (ie, you merge to master, and away it goes to production...)

The zero-downtime part means that as the new code goes out, the old servers are still up and running until the new code is fully loaded and ready to roll... and they only then get pulled down.

This is great for uptime, but does mean you have to be extra careful about any migrations. The database must work with both the old code and the new code.

My colleague pointed me at this article: Rails migrations with no downtime. which has some in-depth coverage of the topic. What kinds of things cause errors, what you can do to reduce the pain of change-over.

No comments: