1 of 24

Feature Flag all the things!

2 of 24

3 of 24

CO-OP

4 of 24

All out

5 of 24

5

6 of 24

6

mec.ca

7 of 24

7

safety

8 of 24

X

X

X

X

9 of 24

  1. monitoring & alerting
  2. test automation
  3. feature flags

10 of 24

feature flag:

mechanism to dynamically control what feature is accessed or used at a given point in time

aka feature toggle

11 of 24

if ( featureIsEnabled("new-feature") ) {

runNewAlgorithm()

} else {

runOldAlgorithm()

}

12 of 24

Toggle feature without deploying new code

Off

On

Feature A

Feature B

Feature C

13 of 24

Kill switch

Off

On

Integration with 3rd party service or newly released feature

aka ops toggle

14 of 24

Dark launch

Off

On

New feature under active development

15 of 24

Incremental rollout

Off

On

New feature

aka canary release

0%

100%

10% of users get the new feature first week

50% of users get the new feature next week

100% the week after

16 of 24

Split test

Off

On

New feature

aka A/B test

0%

100%

Experiment to measure impact of new feature vs current state

17 of 24

Release toggle

Fallback

Latest

Front-end build version

Latest: { "bundle": "build-588" }

Fallback: { "bundle": "build-575" }

18 of 24

Feature bypass

Off

On

Recaptcha on login

Off Whitelist: Test automation agent hosts

19 of 24

20 of 24

Flag configuration

Impressions

SDK / Agent

Flag check

21 of 24

  • almost all new or modified code is behind a flag
  • adding a feature flag is the first step in any change
  • feature flags named after associated Jira ticket
  • feature flags should be disabled by default across all environments
  • enabling feature flag is independent of release; enabled by the person accountable for the feature
  • flags are tagged by type

Practices

22 of 24

  • code duplication within a flag is okay
  • perform regular flag cleanup
  • test all flag conditions (enable/disable)
  • beware of flag leakage
  • do not feature flag bugs

Lessons

23 of 24

  • synchronizing automated integration tests and flags
  • interdependencies between flags

Puzzles

24 of 24

Thanks!

(we’re hiring!)