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

A Tale of Two Feature Flags

Rebecca
November 16, 2015

A Tale of Two Feature Flags

RubyConf 2015

Rebecca

November 16, 2015
Tweet

More Decks by Rebecca

Other Decks in Technology

Transcript

  1. It was the best of times, It was the worst

    of times. It was the age of foolishness, it was the epoch of belief, it was the epoch of incredulity, it was the season of Light, it was the season of Darkness, it was the spring of hope, it was the winter of despair, we had everything before us, we had nothing before us, we were all going direct to Heaven, we were all going direct the other way. November 16
  2. It was the best of times, It was the worst

    of times. It was the age of foolishness, it was the epoch of belief, it was the epoch of incredulity, it was the season of Light, it was the season of Darkness, it was the spring of hope, it was the winter of despair, we had everything before us, we had nothing before us, we were all going direct to Heaven, we were all going direct the other way. November 16
  3. I have an idea! The best of times How are

    feature flags supposed to work?
  4. The best of times I have an idea! How are

    feature flags supposed to work?
  5. The best of times I have an idea! But… •

    It’s a lot of work. How are feature flags supposed to work?
  6. The best of times • It’s a lot of work.

    • I’m worried about deploying months of work all at once. How are feature flags supposed to work? I have an idea! But…
  7. The best of times • It’s a lot of work.

    • I’m worried about deploying months of work all at once. • We’d really like to see how it performs with a small subset of users. How are feature flags supposed to work? I have an idea! But…
  8. The best of times • It’s a lot of work.

    • I’m worried about deploying months of work all at once. • We’d really like to see how it performs with a small subset of users. • There are lots of external dependencies before we can roll it out to everyone. How are feature flags supposed to work? I have an idea! But…
  9. The best of times I have an idea! … so,

    how can I release this feature while minimizing risk? How are feature flags supposed to work?
  10. big_feature: false The best of times Put a feature flag

    on it! Configuration file How are feature flags supposed to work?
  11. The best of times Put a feature flag on it!

    big_feature: false Configuration file .search-results - if toggled_on? big_feature / new view for new feature / existing view UI implementation How are feature flags supposed to work?
  12. big_feature: false The best of times Put a feature flag

    on it! Configuration file UI + UI What the user sees - if toggled_on? big_feature / new view for new feature / existing view UI implementation How are feature flags supposed to work?
  13. The best of times Put a feature flag on it!

    • But it’s a lot of work. • And I’m worried about deploying months of work all at once. • And we’d really like to see how it performs with a small subset of users. • Beyond that, there are lots of external dependencies before we can roll it out to everyone. How are feature flags supposed to work?
  14. • Finer-grained toggling (admin-only, language-specific, location-specific) • A/B testing! •

    Graceful degradation when a feature fails The best of times And that’s just the beginning. How are feature flags supposed to work?
  15. Feature flags in practice (They always start with the best

    of intentions). One clearly-defined feature behind a single flag.
  16. Dependent feature flags Good intentions don’t always align with IRL

    practices. The project’s changed: let’s release different parts to different users!
  17. Dependent feature flags The project’s changed: let’s release different parts

    to different users! Good intentions don’t always align with IRL practices.
  18. Dependent feature flags Segmented releases lead to exponential testing complexity

    what the user sees T T Both features T F F T F F Good intentions don’t always align with IRL practices.
  19. Dependent feature flags Segmented releases lead to exponential testing complexity

    what the user sees T T Both features T F only F T F F Good intentions don’t always align with IRL practices.
  20. Dependent feature flags Segmented releases lead to exponential testing complexity

    what the user sees T T Both features T F only F T ¯\_(ツ)_/¯ F F ¯\_(ツ)_/¯ Good intentions don’t always align with IRL practices.
  21. Dependent feature flags ¯\_(ツ)_/¯ Segmented releases lead to exponential testing

    complexity Good intentions don’t always align with IRL practices.
  22. Dependent feature flags Stick to one flag per feature (Or

    get ready for a manual QA headache)
  23. def search_results # existing pre-flag logic if # append new

    results end end Where to flag? Different developers and teams have different strategies for implementing flags. Feature flags on the backend
  24. Where to flag? Different developers and teams have different strategies

    for implementing flags. Lack of strategy leads to a really beautiful mess.
  25. Where to flag? Different developers and teams have different strategies

    for implementing flags. Removing old flags is hard.
  26. Where to flag? Different developers and teams have different strategies

    for implementing flags. Removing old flags is hard.
  27. Where to flag? Coupled flags quickly become institutionalized as kill

    switches Different developers and teams have different strategies for implementing flags.
  28. Where to flag? Different developers and teams have different strategies

    for implementing flags. Stack Overflow’s read-only mode
  29. features: active_feature: true nonactive_feature: false legacy_homepage: false : true more_payment_types:

    true another_feature: false Long-lived feature flags What happens when flags outlive their utility? Never-ending configuration
  30. features: active_feature: true nonactive_feature: false legacy_homepage: false : true Long-lived

    feature flags Recall a typical config file… Dashboards lack delegation mechanisms
  31. features: : enabled: true deadline: 12-10-2015 maintainer: rsliter Long-lived feature

    flags Delegate deadlines and maintainers through configuration A better way
  32. A better way Long-lived feature flags if .past_deadline? # check

    out a new branch # amend file # cc maintainer in the commit # push new branch Delegate deadlines and maintainers through configuration
  33. Credits • CC image courtesy of Jared Tarbell on Flickr

    • CC image, Tangle, courtesy of loumurphy on Flickr • CC image, Arrows, courtesy of Byron on Flickr • Le Jour ni l’Heure 5941 : Cy Twombly, 1928-2011 • CC image, Volcano • Flip screenshot from Github • Flipper screenshot from Github • Dog gif courtesy Giphy • Error By Knight Capital Rips through Stock Market • Knight’s bizarre trades rattle markets • Knightmare: a Devops Cautionary Tale • Knight Capital Group Thank you!!!