Successfully reported this slideshow.
Your SlideShare is downloading. ×

Integrated Feature Management - Using Feature Flags - MidwestPHP

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad

Check these out next

1 of 143 Ad

Integrated Feature Management - Using Feature Flags - MidwestPHP

Download to read offline

A/B testing? Canary Rollouts? Service maintenance windows? All of these and more can be controlled dynamically by using feature flags. In this presentation, we’ll go over the benefits of feature flags and demonstrate how to effectively incorporate them into your codebase and workflows. You don’t need a fancy service to make this happen - there are several php libraries you can use. In this scenario, I will demonstrate the Swivel library using a MySQL database.

A/B testing? Canary Rollouts? Service maintenance windows? All of these and more can be controlled dynamically by using feature flags. In this presentation, we’ll go over the benefits of feature flags and demonstrate how to effectively incorporate them into your codebase and workflows. You don’t need a fancy service to make this happen - there are several php libraries you can use. In this scenario, I will demonstrate the Swivel library using a MySQL database.

Advertisement
Advertisement

More Related Content

Similar to Integrated Feature Management - Using Feature Flags - MidwestPHP (20)

Advertisement

Recently uploaded (20)

Integrated Feature Management - Using Feature Flags - MidwestPHP

  1. 1. @danaluther Integrated Feature Management Using Feature Flags Dana Luther
  2. 2. @danaluther What are we going to do today, Brain?
  3. 3. @danaluther What are we going to do today, Brain? What are feature flags?
  4. 4. @danaluther What are we going to do today, Brain? What are feature flags? Why do we want to use them?
  5. 5. @danaluther What are we going to do today, Brain? What are feature flags? Why do we want to use them? How do we use and integrate them?
  6. 6. @danaluther What is a feature flag?
  7. 7. @danaluther What is a feature flag? A variable that defines a condition
  8. 8. @danaluther What is a feature flag? A variable that defines a condition A feature toggle (also feature switch, feature flag, feature flipper, conditional feature, etc.) is a technique in software development that attempts to provide an alternative to maintaining multiple source-code branches (known as feature branches), such that a feature can be tested even before it is completed and ready for release. Feature toggle is used to hide, enable or disable the feature during run time. “ “ — Wikipedia
  9. 9. @danaluther https://featureflags.io
  10. 10. @danaluther What is integrated management?
  11. 11. @danaluther What is integrated management? Defining your conditional such that you don’t need to update your codebase to switch features.
  12. 12. @danaluther What is integrated management? Defining your conditional such that you don’t need to update your codebase to switch features. Avoiding feature branches for the win!
  13. 13. @danaluther Feature branch misery …the struggle is real…
  14. 14. @danaluther Feature branch misery …
  15. 15. @danaluther Feature branch misery …
  16. 16. @danaluther Feature branch misery …
  17. 17. @danaluther Feature branch misery …
  18. 18. @danaluther Feature branch misery …
  19. 19. @danaluther Feature branch misery …
  20. 20. @danaluther Feature branch misery …
  21. 21. @danaluther Feature branch misery …
  22. 22. @danaluther Feature branch misery …
  23. 23. @danaluther Feature branch misery …
  24. 24. @danaluther Feature branch misery …
  25. 25. @danaluther Feature branch misery …
  26. 26. @danaluther Feature branch misery …
  27. 27. @danaluther Feature branch misery …
  28. 28. @danaluther Feature branch misery …
  29. 29. @danaluther Feature branch misery …
  30. 30. @danaluther Feature branch misery …
  31. 31. @danaluther Feature branch misery …
  32. 32. @danaluther Feature branch misery …
  33. 33. @danaluther Feature branch misery …
  34. 34. @danaluther Feature branch misery …
  35. 35. @danaluther Feature branch misery …
  36. 36. @danaluther Feature branch misery …
  37. 37. @danaluther Feature branch misery … 2 logic * 3 UI =
  38. 38. @danaluther Can we make it better?
  39. 39. @danaluther Can we make it better? Of Course! (Or we wouldn’t be here right now)
  40. 40. @danaluther Use conditional statements to consolidate the logic branches
  41. 41. @danaluther Consolidate logic branches … master sleepy-greeting
  42. 42. @danaluther Consolidate logic branches …
  43. 43. @danaluther Consolidate logic branches …
  44. 44. @danaluther Consolidate logic branches …
  45. 45. @danaluther Consolidated but separated
  46. 46. @danaluther YAY!! We can get rid of the sleepy branches!
  47. 47. @danaluther YAY!! We can get rid of the sleepy branches! (And there was much rejoicing)
  48. 48. @danaluther YAY!! We can get rid of the sleepy branches! (And there was much rejoicing) …but what about our UI features?
  49. 49. @danaluther Establish condition for view rendering
  50. 50. @danaluther Establish condition for view rendering
  51. 51. @danaluther
  52. 52. @danaluther (And there was much rejoicing)
  53. 53. @danaluther Why do we want to use feature flags?
  54. 54. @danaluther Why do we want to use feature flags? A/B Testing
  55. 55. @danaluther Why do we want to use feature flags? A/B Testing Canary Rollouts
  56. 56. @danaluther Why do we want to use feature flags? A/B Testing Canary Rollouts Maintenance Windows (internal and/or third party)
  57. 57. @danaluther Why do we want to use feature flags? A/B Testing Canary Rollouts Maintenance Windows (internal and/or third party) Seasonal Content / Calendar Driven
  58. 58. @danaluther Why do we want to use feature flags? A/B Testing Canary Rollouts Maintenance Windows (internal and/or third party) Seasonal Content / Calendar Driven See more at: http://featureflags.io/feature-flag-uses/
  59. 59. @danaluther A/B Testing
  60. 60. @danaluther A/B Testing Version A - 50%
  61. 61. @danaluther A/B Testing Version A - 50% Version B - 50%
  62. 62. @danaluther Canary Testing
  63. 63. @danaluther Canary Testing Version A - 90%
  64. 64. @danaluther Canary Testing Version A - 90% Version B - 10%
  65. 65. SIDEBAR: @danaluther Why do they call it canary testing? https://www.smithsonianmag.com/smart-news/story-real-canary-coal-mine-180961570/
  66. 66. @danaluther Canary Testing Version A - 90% Version B - 10%
  67. 67. @danaluther Maintenance Windows “Offline” Mode
  68. 68. @danaluther Maintenance Windows “Normal” Mode “Offline” Mode
  69. 69. @danaluther Maintenance Windows “Normal” Mode “Offline” Mode
  70. 70. @danaluther Seasonal Content
  71. 71. @danaluther Seasonal Content “Normal” Mode
  72. 72. @danaluther Seasonal Content “Normal” Mode “Annual Contest” Mode
  73. 73. @danaluther Why do we want to use feature flags? A/B Testing Canary Rollouts Maintenance Windows (internal and/or third party) Seasonal Content / Calendar Driven See more at: http://featureflags.io/feature-flag-uses/
  74. 74. @danaluther How do we use feature flags?
  75. 75. @danaluther How do we use feature flags? PHP Libraries:
  76. 76. @danaluther How do we use feature flags? PHP Libraries: https://featureflags.io/php-feature-flags/
  77. 77. @danaluther How do we use feature flags? PHP Libraries: https://featureflags.io/php-feature-flags/ https://packagist.org/ (feature flag search)
  78. 78. @danaluther How do we use feature flags? PHP Libraries: https://featureflags.io/php-feature-flags/ https://packagist.org/ (feature flag search) https://packagist.org/packages/zumba/swivel
  79. 79. @danaluther How do we use feature flags? PHP Libraries: https://featureflags.io/php-feature-flags/ https://packagist.org/ (feature flag search) https://packagist.org/packages/zumba/swivel https://packagist.org/packages/dhluther/yii2-swivel
  80. 80. @danaluther Key Concept: User Experience Groups The Cohort
  81. 81. @danaluther User “Buckets” Bucket ID 1
  82. 82. @danaluther User “Buckets” Bucket ID 1 Bucket ID 2
  83. 83. @danaluther User “Buckets” Bucket ID 1 Bucket ID 2 Bucket ID 6
  84. 84. @danaluther User “Buckets” 1 2 3 4 5 6 7 8 9 10 Each bucket = 10% of visitors
  85. 85. @danaluther User “Cohort” 1 2 3 4 5 6 7 8 9 10 If they all experience the same thing - they are in the same cohort.
  86. 86. @danaluther 1 2 3 4 5 6 7 8 9 10 The cohort is defined by the experience. } } Feature A - Cohort A Feature B - Cohort B
  87. 87. @danaluther We know our groups, but does Google?
  88. 88. SIDEBAR: @danaluther https://tagmanager.google.com https://analytics.google.com https://support.google.com/analytics/answer/1009612 https://support.google.com/tagmanager/answer/6164391 GTM and Analytics Resources
  89. 89. @danaluther GTM to Google Analytics - dataLayer dataLayer = [{ "visitorType":"guest", "bucketId":2, "ecommerce":{ "promoView":{ "promotions":[{ "id":"FANCY_WIDGET", "name":“Fancy Widget", "creative":"featured-index", "position":"featured" }] } } }];
  90. 90. @danaluther GTM to Google Analytics - dataLayer dataLayer = [{ "visitorType":"guest", "bucketId":2, "ecommerce":{ "promoView":{ "promotions":[{ "id":"FANCY_WIDGET", "name":“Fancy Widget", "creative":"featured-index", "position":"featured" }] } } }];
  91. 91. @danaluther Set GTM Variable from dataLayer
  92. 92. @danaluther Set the Variable to a Dimension value
  93. 93. @danaluther Google Analytics - Add Dimension
  94. 94. @danaluther Google Analytics - A/B Segments
  95. 95. @danaluther Google Analytics - Bucket Segments
  96. 96. SIDEBAR: @danaluther Instana APM Resources https://instana.com
  97. 97. @danaluther Google is ready … lets try our features
  98. 98. @danaluther Scenario: Canary Release
  99. 99. @danaluther Define Feature Slugs IndexStyle.Fancy IndexStyle.Fancier IndexStyle
  100. 100. @danaluther Assign Features to Buckets / Cohorts Feature Slug Buckets IndexStyle 1,2,3,4,5,6,7,8,9,10 IndexStyle.Fancy 1,2,3,4,5,6,7,8,9,10 IndexStyle.Fancier 9,10 Canary Rollout of IndexStyle.Fancier
  101. 101. @danaluther How Swivel interprets the feature slugs
  102. 102. @danaluther Decouple from code deployment
  103. 103. @danaluther Decouple from code deployment
  104. 104. @danaluther Decouple from code deployment
  105. 105. @danaluther Simple A/B toggle
  106. 106. @danaluther Canary release the fancier UI
  107. 107. @danaluther User Breakdown Default UI Fancy UI Fancier UI IndexStyle.Fancy IndexStyle.Fancier 80% Users0% Users (Killswitch Fallback) 20% Users
  108. 108. @danaluther Check Analytics Performance
  109. 109. @danaluther Fully Release the Feature Feature Slug Buckets IndexStyle 1,2,3,4,5,6,7,8,9,10 IndexStyle.Fancy 1,2,3,4,5,6,7,8,9,10 IndexStyle.Fancier 1,2,3,4,5,6,7,8,9,10
  110. 110. @danaluther Updated User Breakdown Default UI Fancy UI Fancier UI IndexStyle.Fancy IndexStyle.Fancier 0% Users0% Users (Killswitch Fallback) 100% Users
  111. 111. @danaluther Real World Example: New UI IndexStyle.Fancy IndexStyle.Fancier
  112. 112. @danaluther Scenario: A/B Test
  113. 113. @danaluther Define Feature Slugs Greeting.Sleepy Greeting
  114. 114. @danaluther Assign Features to Buckets / Cohorts Feature Slug Buckets Greeting 1,2,3,4,5,6,7,8,9,10 Greeting.Sleepy 6,7,8,9,10 AB Test Sleepy Greeting
  115. 115. @danaluther How Swivel interprets the feature slugs
  116. 116. @danaluther How Swivel interprets the feature slugs
  117. 117. @danaluther Flashback - Consolidated Greeting
  118. 118. @danaluther Flashback - Consolidated Greeting
  119. 119. @danaluther Vanilla Swivel Install - Swivel Feature
  120. 120. @danaluther Swivel Feature - A or B
  121. 121. @danaluther User Breakdown Default Greeting Sleepy Greeting Greeting.Sleepy 50% Users50% Users Cohort A Cohort B
  122. 122. @danaluther Using Google Analytics: A -vs- B
  123. 123. @danaluther Assign Features to Buckets / Cohorts Feature Slug Buckets Greeting 1,2,3,4,5,6,7,8,9,10 Greeting.Sleepy AB Test Sleepy Greeting - A Wins
  124. 124. @danaluther Assign Features to Buckets / Cohorts Feature Slug Buckets Deleted all Greeting features AB Test Sleepy Greeting - A Wins
  125. 125. @danaluther User Breakdown - Sleepy Disabled Default Greeting Sleepy Greeting Greeting.Sleepy 0% Users100% Users Cohort A Cohort B
  126. 126. @danaluther Assign Features to Buckets / Cohorts Feature Slug Buckets Greeting 1,2,3,4,5,6,7,8,9,10 Greeting.Sleepy 1,2,3,4,5,6,7,8,9,10 AB Test Sleepy Greeting - B Wins
  127. 127. @danaluther Assign Features to Buckets / Cohorts Feature Slug Buckets Greeting Greeting.Sleepy 1,2,3,4,5,6,7,8,9,10 AB Test Sleepy Greeting - Oops
  128. 128. @danaluther Assign Features to Buckets / Cohorts Feature Slug Buckets Greeting Greeting.Sleepy 1,2,3,4,5,6,7,8,9,10 AB Test Sleepy Greeting - Oops
  129. 129. @danaluther User Breakdown - Sleepy Disabled Default Greeting Sleepy Greeting Greeting.Sleepy 100% Users0% Users Cohort A Cohort B
  130. 130. @danaluther Real World Example: A/B Location Covid.A Covid.B
  131. 131. @danaluther Scenario: Maintenance Window
  132. 132. @danaluther Assign Features to Buckets / Cohorts Feature Slug Buckets ThirdPartyAPI 1,2,3,4,5,6,7,8,9,10 ThirdPartyAPI.UnderMaintenance 1,2,3,4,5,6,7,8,9,10
  133. 133. @danaluther Real World Example: Maintenance QuotingTool.ProductA.Unavailable
  134. 134. @danaluther Scenario: Seasonal Content
  135. 135. @danaluther Assign Features to Buckets / Cohorts Feature Slug Buckets OurCrazyContest 1,2,3,4,5,6,7,8,9,10 OurCrazyContest.AcceptingEntries 1,2,3,4,5,6,7,8,9,10 OurCrazyContest.VotingOpen OurCrazyContest.FinalistsAnnounced
  136. 136. @danaluther Real World Example: Seasonal/Temp. ISI.Coronavirus.Alert
  137. 137. @danaluther Automate Feature Toggling
  138. 138. @danaluther Automate Feature Toggling Cron or system.d timers
  139. 139. @danaluther Automate Feature Toggling Cron or system.d timers Services that trigger database updates
  140. 140. @danaluther Automate Feature Toggling Cron or system.d timers Services that trigger database updates Sequential API failures automatically trigger ClientApi.Unavailable slug creation
  141. 141. @danaluther Automate Feature Toggling Cron or system.d timers Services that trigger database updates Sequential API failures automatically trigger ClientApi.Unavailable slug creation ?? You tell me!
  142. 142. @danaluther https://featureflags.io
  143. 143. @danaluther Questions?? 🤔 ? ? ? ? https://www.linkedin.com/in/danaluther dluther@envisageinternational.com

×