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.

Fe6b81005d1553accd6b2a28f6a2bef1?s=128

Pete Hodgson

May 11, 2017
Tweet

Transcript

  1. 4.

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

    merge bomb based on: martinfowler.com/bliki/FeatureBranch.html
  2. 8.

    @ph1 #oscon function old_relatedProducts(product){ // current implementation lives here }

    function new_relatedProducts(product){ // TODO: write a better // related products algorithm }
  3. 9.

    @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. 16.

    @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. 17.

    @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. 19.

    @ph1 #oscon function relatedProducts(product){ var useNewAlgorithm = false; if( useNewAlgorithm

    ){ return new_relatedProducts(product); }else{ return old_relatedProducts(product); } }
  7. 39.

    @ph1 #oscon ownership release toggles ops toggles permission toggles experiment

    toggles owned by devs owned by ops owned by product
  8. 42.

    @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. 47.

    @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. 49.

    @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