On this page3 sections
The safest deploys I have shipped went out mid-afternoon, because deploying had stopped being the scary part. The trick is one idea: deploy code dark, release behavior later - and a flag is the switch between them.
What a useful flag system needs
Not much. A flag has a name, an on/off state, a rollout percentage, and optional targeting:
if (flags.isOn('new-checkout', { userId, percentage: 10 })) {
return newCheckout(cart)
}
return legacyCheckout(cart)Bucket users by hash(flagName + userId) % 100 so the same user gets a consistent experience - a checkout that flickers between versions is worse than either version.
The rollout ritual
- Ship at 0%. Verify in production with internal accounts.
- 1% -> watch error rates and business metrics, not vibes.
- 10% -> 50% -> 100% over hours or days depending on blast radius.
- Anything scary keeps a kill switch: one click back to legacy beats one rollback deploy.
Flag hygiene, or the codebase rots
Every flag is a fork in your code. Two rules keep it sane: flags carry an owner and an expiry date in their definition, and “remove flag” goes into the sprint the moment it hits 100%. A three-year-old flag named temp_fix_v2 is not a flag - it is architecture nobody chose.