Today, Shopify runs on Rails 5.0, the latest version. It’s important to us to stay on the latest version so we can improve the performance and stability of the application without having to increase the maintenance cost of applying monkey patches. This guarantees we would always be in the version maintained by the community; and, that we would have access to new features soon. Upgrading the Shopify monolith—one of the oldest and the largest Rails applications in the industry—from Rails 4.2 to 5.0 took us nearly a year. In this post, I’ll share our upgrade story and the lessons we learned. If you're wondering how the Shopify scale looks like or you plan a major Rails upgrade, this post is for you.
Overview
This article details Shopify's upgrade from Rails 4.2 to Rails 5.0, highlighting the challenges faced, the preparation steps taken, and the strategies employed to ensure a smooth transition while maintaining backward compatibility.
What You'll Learn
How to prepare a large Rails application for a major version upgrade
Why maintaining backward compatibility during an upgrade is crucial
How to implement a dual Gemfile strategy for Rails upgrades
When to use CI pipelines to support multiple Rails versions
Prerequisites & Requirements
- Understanding of Rails application architecture and gem dependencies
- Experience with large codebases and version control systems(optional)
Key Questions Answered
What steps did Shopify take to upgrade from Rails 4.2 to 5.0?
How did Shopify handle the challenges of a large codebase during the upgrade?
What were the performance issues encountered after upgrading to Rails 5?
What was the outcome of the upgrade process for Shopify?
Key Statistics & Figures
Technologies & Tools
Some links below are affiliate links. We may earn a commission if you make a purchase.
Key Actionable Insights
1Eliminate deprecated features as soon as possible to simplify future upgrades.Waiting to remove deprecated features can lead to a larger codebase, making it more challenging to upgrade in the future.
2Maintain updated gem dependencies to ease the upgrade process.Regularly upgrading gems can prevent compatibility issues during major framework upgrades, reducing the overall effort required.
3Implement a dual CI pipeline to manage compatibility during upgrades.This approach allows teams to test changes against multiple versions of the framework, ensuring stability and compatibility throughout the upgrade process.