Upgrading GitHub from Rails 3.2 to 5.2

On August 15th GitHub celebrated a major milestone: our main application is now running on the latest version of Rails: 5.2.1! 🎉 In total the project took a year and…

Eileen M. Uchitelle
7 min readbeginner
--
View Original

Overview

GitHub successfully upgraded its main application from Rails 3.2 to 5.2.1 over a year and a half, addressing technical debt and improving the codebase while maintaining ongoing feature development.

What You'll Learn

1

How to implement dual booting for Rails applications

2

Why addressing technical debt is crucial during upgrades

3

When to deploy Rails upgrades with minimal customer impact

Prerequisites & Requirements

  • Understanding of Rails framework and versioning
  • Experience with CI/CD processes(optional)

Key Questions Answered

How did GitHub manage to upgrade Rails without downtime?
GitHub implemented a dual booting strategy, allowing them to run multiple versions of Rails simultaneously. This approach enabled them to deploy changes for the next version without halting feature development or bug fixes, ensuring minimal customer impact during the upgrade process.
What lessons did GitHub learn from the Rails upgrade process?
GitHub learned several key lessons, including the importance of upgrading early and often, maintaining upgrade infrastructure, and addressing technical debt regularly. These insights are aimed at making future upgrades smoother and more efficient, emphasizing the need for incremental upgrades and shared responsibility across teams.
What were the main challenges faced during the Rails upgrade?
The upgrade faced challenges such as major breaking changes between Rails versions and the presence of technical debt in the 10-year-old codebase. The project initially started with limited resources, which complicated the upgrade process as the team learned on the go.

Key Statistics & Figures

Time taken for upgrade from Rails 3.2 to 5.2
1.5 years
This timeframe highlights the complexity of upgrading a large and trafficked application like GitHub.
Time taken for upgrade from Rails 4.2 to 5.2
5 months
This shows the improvement in the upgrade process due to enhancements in Rails 5 series.

Technologies & Tools

Some links below are affiliate links. We may earn a commission if you make a purchase.

Key Actionable Insights

1
Upgrade early and upgrade often to minimize future challenges.
By staying closer to the latest Rails versions, teams can avoid the complexities of major breaking changes and reduce the need for extensive monkey-patching.
2
Implement dual booting for seamless upgrades.
This allows for ongoing feature development while preparing for the next version, thus preventing long-running branches and ensuring that production remains stable.
3
Address technical debt proactively.
Regularly tackling technical debt prevents bottlenecks during upgrades and keeps the codebase maintainable, ensuring that upgrades can be executed with minimal friction.

Common Pitfalls

1
Relying on private APIs can lead to issues during upgrades.
Private APIs are subject to change without notice, which can break functionality when upgrading. It's essential to use documented features to ensure stability.

Related Concepts

Rails Versioning
Technical Debt Management
CI/CD Processes