Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Tech Talk - Feature Flags & Toggles

Tech Talk - Feature Flags & Toggles

Tech talk at Marqeta on 03/21/2019 on Feature Flags and Toggles.

Manish Pandit

March 21, 2019
Tweet

More Decks by Manish Pandit

Other Decks in Programming

Transcript

  1. Feature Toggles Feature Toggles are a powerful technique, allowing teams

    to modify system behavior without changing code Source: https://martinfowler.com/articles/feature-toggles.html
  2. Deconstructing a Feature Toggle Toggle Configuration = on/off | env

    | user id(s) | geo | time | …. (Stored in config-file | database | env-var | in the code | FTaaS) Toggle Context = env | user id(s) | geo | time | logged-in-state | tenant-id | … Toggle Router = reads the toggle configuration + context to determine which toggle point to activate Toggle Point = execution path(s) for the toggle state(s)
  3. Think about it! Does the storage location of a Toggle

    Configuration affect when it can be toggled?
  4. Think about it! Does the storage location of a Toggle

    Configuration affect when it can be toggled? build | deploy | startup | runtime
  5. Release Toggles Decouple releases from deployments Referred a lot in

    the context of Continuous Integration (CI) Allow for large feature branches to be merged in master Long lived (based on how long the feature branches take - weeks? months?)
  6. Experiment Toggles Used to gather data to help pick the

    right feature (Mostly) used with end user interaction use cases (Can also be) used to tune system performance Short lived (weeks)
  7. Operational Toggles Used to turn off features to control unknowns/unexpected

    Almost exclusively used in Production Short lived (days) till a baseline is established Can be lifetime (kill switches!) Help with graceful degradation
  8. Permission Toggles Used to change behavior for a partial set

    of users May need to evaluate the user authorizations Canary, or incremental rollouts Beta, Early Adopters (or Early Winners as we call ‘em!) Can be very short (hours) or long (lifetime) lived
  9. Pick the right place to store the toggle configuration (Ask

    the audience if they remember the storage options!)
  10. Do not name your toggles after pets, food, places..you get

    the point Follow a naming convention
  11. Feature flags can turn into technical debt real quick -

    delete them once not in use. Hint : If a transient flag has been in the same state for a long time, it is not needed.
  12. Resources Feature Toggles (aka Feature Flags) : https://martinfowler.com/articles/feature-toggles.html When Feature

    flags go bad - Edith Harbaugh : https://www.youtube.com/watch?v=28ZAoStv-Xw Getting Started with Feature Flags - #1 LaunchDarkly Feature Flags : https://www.youtube.com/watch?v=pwA_Ehp2SMY