Skip to content
Optimal Lab

System design · interactive

Feature flags and gradual rollout

The new checkout is deployed but switched off. A flag decides, per user, who sees it: staff first, then a growing percentage. Users are bucketed by hashing their id, so raising 10% to 30% keeps the first 10% in and adds more.

7633147152990472836557493123150698879576331471529904324865486710297291385749301192735435169778423426128476685527159409778836421211925069123126458872219907152856647285738019385776951433486796

Number: the user's hash bucket (0–99). Filled: sees the new checkout. Green outline: staff.

if (killSwitch) return false
if (user.isStaff) return true
return hash("new-checkout:" + user.id) % 100 < 10

14 of 100 users on the new checkout

Users whose bucket is below 10 get it. Raise the slider: nobody who had it loses it, and nobody flips back and forth between page loads.

Staff first

Kill switch

  1. 1

  2. 2

    Rules run in order. Try it on yourself first, then on a small slice of real traffic.

    Watch errors and metrics per variant.

  3. 3

  4. 4

In production

Tools and technologies

Flag platforms handle targeting and rollout for you.

Not tied to one language — use these names when you search docs or design a system.