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.
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
11. @danaluther
What is integrated management?
Defining your conditional such that you don’t need to update your
codebase to switch features.
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!
56. @danaluther
Why do we want to use feature flags?
A/B Testing
Canary Rollouts
Maintenance Windows (internal and/or third party)
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. @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/
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/
76. @danaluther
How do we use feature flags?
PHP Libraries:
https://featureflags.io/php-feature-flags/
77. @danaluther
How do we use feature flags?
PHP Libraries:
https://featureflags.io/php-feature-flags/
https://packagist.org/ (feature flag search)
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. @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
112. @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
121. @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
122. @danaluther
Assign Features to Buckets / Cohorts
Feature Slug Buckets
Deleted all Greeting features
AB Test Sleepy Greeting - A Wins
123. @danaluther
User Breakdown - Sleepy Disabled
Default
Greeting
Sleepy
Greeting
Greeting.Sleepy
0% Users100% Users
Cohort A Cohort B
124. @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
125. @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
126. @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
127. @danaluther
User Breakdown - Sleepy Disabled
Default
Greeting
Sleepy
Greeting
Greeting.Sleepy
100% Users0% Users
Cohort A Cohort B