---
title: "Using Betas to Deploy New Features Safely"
description: "Continuous deployment makes changing a running system risky, especially for a platform serving more than a million merchants and changing code multiple times daily. The post presents beta flags as a control mechanism: per-Subject BetaFlags support explicit activation, while BetaRollouts use a percentage and a digest-based modulo calculation to assign a stable, growing subset as rollout increases. It then places a higher-level Feature abstraction above those primitives, allowing direct targeting, percentage rollout, per-Subject opt-outs, and a 100% kill switch that can halt a feature without deleting thousands of database records. The guidance also covers testing permutations, notifying owners through BetaIdentifier metadata, and removing stale flags after rollout. These patterns provide operational control and safer deployment, while requiring substantial implementation and ongoing cleanup."
---

# Using Betas to Deploy New Features Safely

[Shopify](https://yomu.fyi/company/shopify) · 2023-10-18 · Feb 12, 2021

**Type:** Explainer

## Summary

Continuous deployment makes changing a running system risky, especially for a platform serving more than a million merchants and changing code multiple times daily. The post presents beta flags as a control mechanism: per-Subject BetaFlags support explicit activation, while BetaRollouts use a percentage and a digest-based modulo calculation to assign a stable, growing subset as rollout increases. It then places a higher-level Feature abstraction above those primitives, allowing direct targeting, percentage rollout, per-Subject opt-outs, and a 100% kill switch that can halt a feature without deleting thousands of database records. The guidance also covers testing permutations, notifying owners through BetaIdentifier metadata, and removing stale flags after rollout. These patterns provide operational control and safer deployment, while requiring substantial implementation and ongoing cleanup.

## Context

Shopify practices continuous deployment, with code changing multiple times each day, so new features must be de-risked for a platform serving more than a million merchants. Directly applying flags to many Subjects can make rollback difficult during an incident because thousands of database records may not be removable quickly.

## Approach / What changed

Use BetaIdentifier, BetaFlag, and BetaRollout primitives for explicit and percentage-based activation, with digest-based stable sampling. Add a higher-level Feature abstraction that supports direct targeting, percentage rollout, per-Subject opt-outs, and a 100% kill switch. Complement the mechanism with metadata-driven notifications, targeted testing, and eventual flag cleanup.

## Takeaways

- A digest of the Subject and beta identifiers, reduced modulo 100, keeps rollout membership stable as the percentage increases, so previously enabled Subjects remain enabled.
- A percentage rollback can set BetaRollout to 0, but explicit BetaFlags remain active; a higher-level opt-out rollout at 100% provides a kill switch when direct records are difficult to remove.
- Feature flags add code-path permutations. Teams may run selected test files twice for complex features, audit tests when flags are removed, and clean up stale flags to avoid dead code and technical debt.

**Tags:** [Architecture](https://yomu.fyi/topic/architecture), [Deployment](https://yomu.fyi/topic/deployment), [Testing](https://yomu.fyi/topic/testing)

- Source: [Shopify](https://shopify.engineering/using-betas-to-deploy-new-features-safely)
- Source URL: https://shopify.engineering/using-betas-to-deploy-new-features-safely
- Ingested by Yomu: 2026-08-31T01:10:22.854Z

[Read original post](https://shopify.engineering/using-betas-to-deploy-new-features-safely)
