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

A Journey Into Feature Toggles - OSCON Austin 2017

A Journey Into Feature Toggles - OSCON Austin 2017

Feature toggles (aka feature flags) are a set of patterns that enable dev teams to deliver features to users rapidly and safely. Pete Hodgson leads you on a journey with a dev team as they adopt feature toggles, covering what they are, why they're helpful, and how to use them successfully.

Pete Hodgson

May 11, 2017
Tweet

More Decks by Pete Hodgson

Other Decks in Programming

Transcript

  1. @ph1 #oscon master ! Sam's feature branch Jesse’s feature branch

    merge bomb based on: martinfowler.com/bliki/FeatureBranch.html
  2. @ph1 #oscon function old_relatedProducts(product){ // current implementation lives here }

    function new_relatedProducts(product){ // TODO: write a better // related products algorithm }
  3. @ph1 #oscon function relatedProducts(product){ var useNewAlgorithm = false; if( useNewAlgorithm

    ){ return new_relatedProducts(product); }else{ return old_relatedProducts(product); } } function old_relatedProducts(product){ // current implementation lives here } function new_relatedProducts(product){ // TODO: write a better // related products algorithm }
  4. @ph1 #oscon function relatedProducts(product){ var useNewAlgorithm = false; if( useNewAlgorithm

    ){ return new_relatedProducts(product); }else{ return old_relatedProducts(product); } } function old_relatedProducts(product){ // current implementation lives here } function new_relatedProducts(product){ // TODO: write a better // related products algorithm }
  5. @ph1 #oscon function relatedProducts(product){ var useNewAlgorithm = false; if( useNewAlgorithm

    ){ return new_relatedProducts(product); }else{ return old_relatedProducts(product); } } function old_relatedProducts(product){ // current implementation lives here } function new_relatedProducts(product){ // TODO: write a better // related products algorithm } true;
  6. @ph1 #oscon function relatedProducts(product){ var useNewAlgorithm = false; if( useNewAlgorithm

    ){ return new_relatedProducts(product); }else{ return old_relatedProducts(product); } }
  7. @ph1 #oscon ownership release toggles ops toggles permission toggles experiment

    toggles owned by devs owned by ops owned by product
  8. @ph1 #oscon if( featureEnabled(“use-new-related-products-algo”) ){ // do X }else{ //

    do Y } if( featureEnabled(“use-new-related-products-algo”) ){ // do X }else{ // do Y } if( featureEnabled(“use-new-related-products-algo”) ){ // do X }else{ // do Y } if( featureEnabled(“use-new-related-products-algo”) ){ // do X }else{ // do Y }
  9. @ph1 #oscon function renderProductDetailsPage(){ if( featureEnabled(“show-related-products”) ){ renderProductDetailsSection({renderBuyButton:true}); renderRelatedProductSection(); }else{

    renderProductDetailsSection({renderBuyButton:false}); renderReallyBigBuyButton(); } } function renderProductDetailsPage(){ if( featureEnabled(“show-related-products”,request) ){ renderProductDetailsSection({renderBuyButton:true}); renderRelatedProductSection(); }else{ renderProductDetailsSection({renderBuyButton:false}); renderReallyBigBuyButton(); } }
  10. @ph1 #oscon toggle configuraLon Hard-coded
 in source config baked
 into

    deployment parameterized
 config config in
 the app DB distributed config
 (e.g. Consul, ZooKeeper) sta1c dynamic