Living on the Edge of Rails

Shopify's Core monolith has been running the latest revision of the Rails framework in production since Feb 2019.

Edouard CHIN
5 min readbeginner
--
View Original

Overview

The article discusses Shopify's approach to keeping their Rails dependencies up to date by living on the Edge of Rails, which allows them to integrate the latest changes continuously. It highlights the benefits of this strategy, including reduced upgrade times and improved community contributions.

What You'll Learn

1

How to continuously integrate the latest Rails changes into your application

2

Why living on the Edge of Rails can reduce technical debt

3

When to consider using unreleased versions of dependencies

Prerequisites & Requirements

  • Understanding of Rails and dependency management
  • Experience with continuous integration practices(optional)

Key Questions Answered

What does it mean to live on the Edge of Rails?
Living on the Edge of Rails means using the Rails master branch, allowing immediate access to new features and fixes as they are committed. This approach eliminates the wait for official releases, enabling faster updates and improvements.
How does Shopify manage Rails upgrades with Solid Track?
Shopify uses a bot named Solid Track to automatically upgrade Rails weekly. It opens a Pull Request with the changes and alerts the team to review the updates, ensuring that they can quickly adapt to new commits while maintaining stability.
What are the risks of targeting the HEAD of Rails?
Targeting the HEAD of Rails introduces potential stability risks since it involves using unreleased versions. Shopify mitigates this by ensuring robust monitoring, a comprehensive test suite, and canary deployments to minimize impact from any issues.

Key Statistics & Figures

Number of tests in the CI suite
130,000
This extensive test suite helps Shopify identify edge cases and improve the Rails framework.

Technologies & Tools

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

Backend
Rails
Framework used for building Shopify's application.
Backend
Zeitwerk
New autoloader introduced with Rails 6, which Shopify contributed to improving.

Key Actionable Insights

1
Consider implementing a bot for automatic dependency updates to streamline your upgrade process.
Automating dependency updates can save time and reduce the risk of technical debt accumulation. This approach allows teams to focus on feature development rather than spending months on upgrades.
2
Evaluate your monitoring and testing strategies before adopting unreleased dependencies.
Having strong monitoring and a comprehensive test suite is crucial when using cutting-edge technologies. This preparation helps catch potential issues early and ensures a smoother deployment process.
3
Utilize canary deployments to reduce the risk of introducing breaking changes in production.
Canary deployments allow you to test new changes on a small subset of servers before a full rollout. This strategy helps identify issues without affecting the entire user base.

Common Pitfalls

1
Failing to adequately monitor applications when using unreleased dependencies can lead to undetected issues.
Without proper monitoring, teams may overlook critical failures that arise from new changes, resulting in degraded application performance or outages.

Related Concepts

Continuous Integration
Dependency Management
Canary Deployments