Integrated Feature Management - Using Feature Flags - PHPSerbia

@danaluther
Integrated Feature Management
Using Feature Flags
Dana Luther
@danaluther
What are we going to do today, Brain?
@danaluther
What are we going to do today, Brain?
What are feature flags?
@danaluther
What are we going to do today, Brain?
What are feature flags?
Why do we want to use them?
@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?
@danaluther
What is a feature flag?
@danaluther
What is a feature flag?
A variable that defines a condition
@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
@danaluther
https://featureflags.io
@danaluther
What is integrated management?
@danaluther
What is integrated management?
Defining your conditional such that you don’t need to update your
codebase to switch features.
@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!
@danaluther
Feature branch misery
…the struggle is real…
@danaluther
Feature branch misery …
@danaluther
Feature branch misery …
@danaluther
Feature branch misery …
@danaluther
Feature branch misery …
@danaluther
Feature branch misery …
@danaluther
Feature branch misery …
@danaluther
Feature branch misery …
@danaluther
Feature branch misery …
@danaluther
Feature branch misery …
@danaluther
Feature branch misery …
@danaluther
Feature branch misery …
@danaluther
Feature branch misery …
@danaluther
Feature branch misery …
@danaluther
Feature branch misery …
@danaluther
Feature branch misery …
@danaluther
Feature branch misery …
@danaluther
Feature branch misery …
@danaluther
Feature branch misery …
@danaluther
Feature branch misery …
@danaluther
Feature branch misery …
@danaluther
Feature branch misery …
@danaluther
Feature branch misery …
@danaluther
Feature branch misery …
@danaluther
Feature branch misery …
2 logic * 3 UI =
@danaluther
Can we make it better?
@danaluther
Can we make it better?
Of Course! (Or we wouldn’t be here right now)
@danaluther
Use conditional statements to
consolidate the logic branches
@danaluther
Consolidate logic branches …
master
sleepy-greeting
@danaluther
Consolidate logic branches …
@danaluther
Consolidate logic branches …
@danaluther
Consolidate logic branches …
@danaluther
Consolidated but separated
@danaluther
YAY!!
We can get rid of the sleepy branches!
@danaluther
YAY!!
We can get rid of the sleepy branches!
(And there was much rejoicing)
@danaluther
YAY!!
We can get rid of the sleepy branches!
(And there was much rejoicing)
…but what about our UI features?
@danaluther
Establish condition for view rendering
@danaluther
Establish condition for view rendering
@danaluther
@danaluther
(And there was much rejoicing)
@danaluther
Why do we want to use feature flags?
@danaluther
Why do we want to use feature flags?
A/B Testing
@danaluther
Why do we want to use feature flags?
A/B Testing
Canary Rollouts
@danaluther
Why do we want to use feature flags?
A/B Testing
Canary Rollouts
Maintenance Windows (internal and/or third party)
@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
@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/
@danaluther
A/B Testing
@danaluther
A/B Testing
Version A - 50%
@danaluther
A/B Testing
Version A - 50% Version B - 50%
@danaluther
Canary Testing
@danaluther
Canary Testing
Version A - 90%
@danaluther
Canary Testing
Version A - 90% Version B - 10%
SIDEB
AR:
@danaluther
Why do they call it canary testing?
https://www.smithsonianmag.com/smart-news/story-real-canary-coal-mine-180961570/
@danaluther
Canary Testing
Version A - 90% Version B - 10%
@danaluther
Maintenance Windows
“Offline” Mode
@danaluther
Maintenance Windows
“Normal” Mode “Offline” Mode
@danaluther
Maintenance Windows
“Normal” Mode “Offline” Mode
@danaluther
Seasonal Content
@danaluther
Seasonal Content
“Normal” Mode
@danaluther
Seasonal Content
“Normal” Mode “Annual Contest” Mode
@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/
@danaluther
How do we use feature flags?
@danaluther
How do we use feature flags?
PHP Libraries:
@danaluther
How do we use feature flags?
PHP Libraries:
https://featureflags.io/php-feature-flags/
@danaluther
How do we use feature flags?
PHP Libraries:
https://featureflags.io/php-feature-flags/
https://packagist.org/ (feature flag search)
@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
@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
@danaluther
Key Concept: User Experience Groups
The Cohort
@danaluther
User “Buckets”
Bucket ID 1
@danaluther
User “Buckets”
Bucket ID 1
Bucket ID 2
@danaluther
User “Buckets”
Bucket ID 1
Bucket ID 2
Bucket ID 6
@danaluther
User “Buckets”
1 2 3 4 5 6 7 8 9 10
Each bucket = 10% of visitors
@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.
@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
@danaluther
We know our groups, but does
Google?
SIDEB
AR:
@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
@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"
}]
}
}
}];
@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"
}]
}
}
}];
@danaluther
Set GTM Variable from dataLayer
@danaluther
Set the Variable to a Dimension value
@danaluther
Google Analytics - Add Dimension
@danaluther
Google Analytics - A/B Segments
@danaluther
Google Analytics - Bucket Segments
SIDEB
AR:
@danaluther
Instana APM Resources
https://instana.com
@danaluther
Google is ready … lets try our features
@danaluther
Scenario: Canary Release
@danaluther
Define Feature Slugs
IndexStyle.Fancy IndexStyle.Fancier
IndexStyle
@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
@danaluther
How Swivel interprets the feature slugs
@danaluther
Decouple from code deployment
@danaluther
Decouple from code deployment
@danaluther
Decouple from code deployment
@danaluther
Simple A/B toggle
@danaluther
Canary release the fancier UI
@danaluther
User Breakdown
Default
UI
Fancy
UI
Fancier
UI
IndexStyle.Fancy IndexStyle.Fancier
80% Users
0% Users
(Killswitch Fallback)
20% Users
@danaluther
Check Analytics Performance
@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
@danaluther
Updated User Breakdown
Default
UI
Fancy
UI
Fancier
UI
IndexStyle.Fancy IndexStyle.Fancier
0% Users
0% Users
(Killswitch Fallback)
100% Users
@danaluther
Real World Example: New UI
IndexStyle.Fancy IndexStyle.Fancier
@danaluther
Scenario: A/B Test
@danaluther
Define Feature Slugs
Greeting.Sleepy
Greeting
@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
@danaluther
How Swivel interprets the feature slugs
@danaluther
How Swivel interprets the feature slugs
@danaluther
Flashback - Consolidated Greeting
@danaluther
Flashback - Consolidated Greeting
@danaluther
Vanilla Swivel Install - Swivel Feature
@danaluther
Swivel Feature - A or B
@danaluther
User Breakdown
Default
Greeting
Sleepy
Greeting
Greeting.Sleepy
50% Users
50% Users
Cohort A Cohort B
@danaluther
Using Google Analytics: A -vs- B
@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
@danaluther
Assign Features to Buckets / Cohorts
Feature Slug Buckets
Deleted all Greeting features
AB Test Sleepy Greeting - A Wins
@danaluther
User Breakdown - Sleepy Disabled
Default
Greeting
Sleepy
Greeting
Greeting.Sleepy
0% Users
100% Users
Cohort A Cohort B
@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
@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
@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
@danaluther
User Breakdown - Sleepy Disabled
Default
Greeting
Sleepy
Greeting
Greeting.Sleepy
100% Users
0% Users
Cohort A Cohort B
@danaluther
Real World Example: A/B Location
Covid.A Covid.B
@danaluther
Scenario: Maintenance Window
@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
@danaluther
Real World Example: Maintenance
QuotingTool.ProductA.Unavailable
@danaluther
Scenario: Seasonal Content
@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
@danaluther
Real World Example: Seasonal/Temp.
ISI.Coronavirus.Alert
@danaluther
Automate Feature Toggling
@danaluther
Automate Feature Toggling
Cron or system.d timers
@danaluther
Automate Feature Toggling
Cron or system.d timers
Services that trigger database updates
@danaluther
Automate Feature Toggling
Cron or system.d timers
Services that trigger database updates
Sequential API failures automatically trigger ClientApi.Unavailable slug
creation
@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!
@danaluther
https://featureflags.io
@danaluther
Questions??
🤔
?
? ?
?
https://www.linkedin.com/in/danaluther
dluther@envisageinternational.com
1 of 143

More Related Content

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

Integrated Feature Management - Using Feature Flags - PHPSerbia