BlogsShopifyFeature Flagging and Rollout System

Feature Flagging and Rollout System

Feature Flagging and Rollout System

1
posts
2021

This feature thread tracks the development and enhancement of Shopify's system for safely deploying new features using beta flags and phased rollouts. Initial efforts focused on reducing the blast radius of changes by rolling out features to a percentage of users, enabling instantaneous activation and rollback. The system defines core concepts like Subjects, BetaIdentifiers, BetaFlags (explicit per-Subject toggles), and BetaRollouts (percentage-based distribution). A key innovation is the performant `BetaRollout#enabled?` method using a digest modulo 100 to ensure consistent subject selection across rollout percentages. The thread also discusses the evolution to a higher-level 'Feature' abstraction to provide more flexibility, including escape hatches and kill switches, and highlights considerations for data compatibility, rollback disruption, and avoiding identifier reuse.

2021

Using Betas to Deploy New Features Safely - Shopify

2/12/2021

This post introduces the concept of beta flags as a mechanism for safe feature deployment in continuous deployment environments. It details the anatomy of a beta flag system, defining 'Subject', 'BetaIdentifier', 'BetaFlag', and 'BetaRollout'. A key technical contribution is the implementation of a performant `BetaRollout#enabled?` method using a digest modulo 100 for consistent percentage-based rollouts. The post also proposes a higher-level 'Feature' abstraction to offer greater flexibility for rollouts, rollbacks, and escape hatches, and discusses important considerations like data structure reconciliation and the limitations of rollback for certain features.