SlideShare a Scribd company logo
1 of 71
Release your
software anytime
Feature Toggles
Alabe Duarte
@alabeduarte
Software Engineer
The need to
release
frequently
Competitive
Advantage
Accurate
Decisions
Continuous Delivery
https://electric-cloud.com/solutions/continuous-delivery/
Small
Releases
Risk
Reduction
Confidence
https://spotifylabscom.files.wordpress.com/2014/03/spotify-engineering-culture-part1.jpeg
Constraints....
The Starting
Point
Continuous Delivery - deployment pipeline
Commit
Stage
Acceptance
Test
Staging Production
Continuous Delivery != Continuous Deployment
Commit
Stage
Acceptance
Test
Staging Production
Commit
Stage
Acceptance
Test
Staging Production
Continuous Delivery
Continuous Deployment
MANUAL
AUTO
The software
has to work
Who practices CD?
Continuous
Delivery is a
journey
Tech
Process
People
Tech
✓ Deployment Pipeline
✓ Test coverage
✓ Automation
Process
✓ Communication
✓ Value driven
✓ Feedback loop
People
✓ Quality Mindset
✓ Team player
✓ Discipline
“Everybody has
responsibility for the
release process”
https://electric-cloud.com/solutions/continuous-delivery/
Feature
Toggles
(Flags/Switch/Flipping)
if (featureToggle.isOn) {
// display flash sale
// hide top downloaded games
} else {
// display top downloaded games
}
Situations where feature toggles may be applied
• White-labeled product
• Seasonal releases
• Experiment toggles
• Operational toggles
• Release toggles
White-labeled product
Seasonal Releases
Experimental toggles
http://growthmetricsco.com/ab-testing-your-shopping-cart-page/
Release toggles
fork
commit pull requestcommit
master
merge
Let’s say we have a team
A TEAM
fork
commit pull requestcommit
master
merge
fork
commit pull requestcommit merge
“Every commit must be
production ready, it may
be released to the
customer any time.”
fork
commit pull request
master
merge
fork
commit pull request merge
Release toggles (feature branches example)
Example
Feature #1
Heart Beating
Status
it('indicates that heart is beating', () => {
const dataIntervals = [
{ timestamp: '2017-03-16T06:00', signal: 1 },
{ timestamp: '2017-03-16T06:30', signal: 0 },
{ timestamp: '2017-03-16T07:00', signal: 1 },
];
expect(heartMonitor.getStatus(dataIntervals)).to.eql(HeartBeating);
});
it('indicates that heart has stopped beating when signal remains the same', () => {
const dataIntervals = [
{ timestamp: '2017-03-16T06:00', signal: 0 },
{ timestamp: '2017-03-16T06:30', signal: 0 },
{ timestamp: '2017-03-16T07:00', signal: 0 },
];
expect(heartMonitor.getStatus(dataIntervals)).to.eql(StoppedBeating);
});
class HeartMonitor {
getStatus (dataIntervals) {
const allSignals = dataIntervals.map( (data) => data.signal );
const flatLine = allSignals.every( (signal) => signal === 0 );
return flatLine ? STATUS.STOPPED_BEATING : STATUS.HEART_BEATING;
}
}
HeartMonitor
✓ indicates that heart has stopped beating when signal remains the same
✓ indicates that heart is beating
2 passing
Feature #2
Indicates Stop
Beating Status
when the line is
flat
Stopped Beating!
describe('HeartMonitor', () => {
const featureToggle = { stopBeatingWhenSignalRemainsTheSame: true };
const heartMonitor = new HeartMonitor(featureToggle);
it('indicates that heart is beating', () => {
// ...
expect(heartMonitor.getStatus(dataIntervals)).to.eql(HeartBeating);
});
it('indicates that heart has stopped beating when all signals are zero', () => {
// ...
expect(heartMonitor.getStatus(dataIntervals)).to.eql(StoppedBeating);
});
it('indicates that heart has stopped beating when signal remains the same', () => {
// ...
expect(heartMonitor.getStatus(dataIntervals)).to.eql(StoppedBeating);
});
describe('when toggle is OFF', () => {
const featureToggle = { stopBeatingWhenSignalRemainsTheSame: false };
const heartMonitor = new HeartMonitor(featureToggle);
it('indicates that heart is beating when non zero signals remain the same', () => {
// ...
expect(heartMonitor.getStatus(dataIntervals)).to.eql(HeartBeating);
});
});
// ...
class HeartMonitor {
constructor(featureToggle) {
this.featureToggle = featureToggle;
}
getStatus (dataIntervals) {
const flatLine = this.isFlatLine(dataIntervals);
return flatLine ? STATUS.STOPPED_BEATING : STATUS.HEART_BEATING;
}
isFlatLine (dataIntervals) {
const allSignals = dataIntervals.map( (data) => data.signal );
return allSignals.every( (signal) => {
return this.featureToggle.stopBeatingWhenSignalRemainsTheSame ?
signal === allSignals[0] : signal === 0;
});
}
}
HeartMonitor
✓ indicates that heart is beating
✓ indicates that heart is beating when non zero signals remain the same
✓ indicates that heart has stopped beating when signal remains the same
when toggle is OFF
✓ indicates that heart is beating when non zero signals remain the same
✓ indicates that heart has stopped beating when all signals are zero
4 passing
Visualising flag statuses
http://blog.launchdarkly.com/launched-flag-status-indicators/
Toggle recycling
Pragmateam/feature-toggles
github.com
Stability
&
Flexibility
open/close
principle from
S.O.L.I.D
Branch by Abstraction
A B
F
C
Branch by Abstraction
A B
F
C
F’
Branch by Abstraction
A B C
F’
F F
Branch by Abstraction
A B C
F’
F F
Branch by Abstraction
A B C
F’
F
https://www.greenbird.com/2016/09/02/microservices-hitting-the-brick-wall-once-again/
Microservices
Microservices - Serverless Architecture
https://softwareengineeringdaily.com/2016/08/23/serverless-architecture-with-mike-roberts/
Microservices - Event Driven Architecture
https://dzone.com/articles/publish-subscribe-pubsub-taken-to-the-next-level-w
“The art of
destroying
Software”
by Greg Young
Wrapping up
Don’t let your
team down
Be aware of
your boundaries
Small
Releases
Release
Frequently
➔ https://continuousdelivery.com/
➔ http://continuous-delivery.co.uk/
➔ https://pragprog.com/book/mnee/release-it
➔ https://martinfowler.com/articles/feature-toggles.html
➔ https://martinfowler.com/bliki/BranchByAbstraction.html
References
https://goo.gl/VJEbQ3
#PragmaThanks

More Related Content

What's hot

Building High-Throughput, Low-Latency Pipelines in Kafka
Building High-Throughput, Low-Latency Pipelines in KafkaBuilding High-Throughput, Low-Latency Pipelines in Kafka
Building High-Throughput, Low-Latency Pipelines in Kafka
confluent
 

What's hot (20)

Crunchy containers
Crunchy containersCrunchy containers
Crunchy containers
 
The Zen of High Performance Messaging with NATS
The Zen of High Performance Messaging with NATS The Zen of High Performance Messaging with NATS
The Zen of High Performance Messaging with NATS
 
Automation CICD
Automation CICDAutomation CICD
Automation CICD
 
Edge architecture ieee international conference on cloud engineering
Edge architecture   ieee international conference on cloud engineeringEdge architecture   ieee international conference on cloud engineering
Edge architecture ieee international conference on cloud engineering
 
A cloud readiness assessment framework
A cloud readiness assessment frameworkA cloud readiness assessment framework
A cloud readiness assessment framework
 
20220224台中演講k8s
20220224台中演講k8s20220224台中演講k8s
20220224台中演講k8s
 
Devops - Microservice and Kubernetes
Devops - Microservice and KubernetesDevops - Microservice and Kubernetes
Devops - Microservice and Kubernetes
 
Kubernetes Architecture and Introduction
Kubernetes Architecture and IntroductionKubernetes Architecture and Introduction
Kubernetes Architecture and Introduction
 
Ensuring Kubernetes Cost Efficiency across (many) Clusters - DevOps Gathering...
Ensuring Kubernetes Cost Efficiency across (many) Clusters - DevOps Gathering...Ensuring Kubernetes Cost Efficiency across (many) Clusters - DevOps Gathering...
Ensuring Kubernetes Cost Efficiency across (many) Clusters - DevOps Gathering...
 
Zero Trust Run-time Kubernetes Security made easy with AccuKnox
Zero Trust Run-time Kubernetes Security made easy with AccuKnoxZero Trust Run-time Kubernetes Security made easy with AccuKnox
Zero Trust Run-time Kubernetes Security made easy with AccuKnox
 
Building High-Throughput, Low-Latency Pipelines in Kafka
Building High-Throughput, Low-Latency Pipelines in KafkaBuilding High-Throughput, Low-Latency Pipelines in Kafka
Building High-Throughput, Low-Latency Pipelines in Kafka
 
Accelerate your DevOps
Accelerate your DevOpsAccelerate your DevOps
Accelerate your DevOps
 
Cilium - Bringing the BPF Revolution to Kubernetes Networking and Security
Cilium - Bringing the BPF Revolution to Kubernetes Networking and SecurityCilium - Bringing the BPF Revolution to Kubernetes Networking and Security
Cilium - Bringing the BPF Revolution to Kubernetes Networking and Security
 
Event Driven Architecture
Event Driven ArchitectureEvent Driven Architecture
Event Driven Architecture
 
About DevOps in simple steps
About DevOps in simple stepsAbout DevOps in simple steps
About DevOps in simple steps
 
Gitlab, GitOps & ArgoCD
Gitlab, GitOps & ArgoCDGitlab, GitOps & ArgoCD
Gitlab, GitOps & ArgoCD
 
Kubernetes Concepts And Architecture Powerpoint Presentation Slides
Kubernetes Concepts And Architecture Powerpoint Presentation SlidesKubernetes Concepts And Architecture Powerpoint Presentation Slides
Kubernetes Concepts And Architecture Powerpoint Presentation Slides
 
[GuideDoc] Deploy EKS thru eksctl - v1.22_v0.105.0.pdf
[GuideDoc] Deploy EKS thru eksctl - v1.22_v0.105.0.pdf[GuideDoc] Deploy EKS thru eksctl - v1.22_v0.105.0.pdf
[GuideDoc] Deploy EKS thru eksctl - v1.22_v0.105.0.pdf
 
Continuously Innovate: GitLab's Approach to PM by GitLab Sr PM
Continuously Innovate: GitLab's Approach to PM by GitLab Sr PMContinuously Innovate: GitLab's Approach to PM by GitLab Sr PM
Continuously Innovate: GitLab's Approach to PM by GitLab Sr PM
 
An Introduction to Kubernetes
An Introduction to KubernetesAn Introduction to Kubernetes
An Introduction to Kubernetes
 

Similar to Release your software anytime - feature toggles

Creating Asha Games: Game Pausing, Orientation, Sensors and Gestures
Creating Asha Games: Game Pausing, Orientation, Sensors and GesturesCreating Asha Games: Game Pausing, Orientation, Sensors and Gestures
Creating Asha Games: Game Pausing, Orientation, Sensors and Gestures
Jussi Pohjolainen
 
Eff Plsql
Eff PlsqlEff Plsql
Eff Plsql
afa reg
 

Similar to Release your software anytime - feature toggles (20)

Unit testing en iOS @ MobileCon Galicia
Unit testing en iOS @ MobileCon GaliciaUnit testing en iOS @ MobileCon Galicia
Unit testing en iOS @ MobileCon Galicia
 
Oop object oriented programing topics
Oop object oriented programing topicsOop object oriented programing topics
Oop object oriented programing topics
 
Arduino section programming slides
Arduino section programming slidesArduino section programming slides
Arduino section programming slides
 
Writing more complex models
Writing more complex modelsWriting more complex models
Writing more complex models
 
Coroutines in Kotlin. In-depth review
Coroutines in Kotlin. In-depth reviewCoroutines in Kotlin. In-depth review
Coroutines in Kotlin. In-depth review
 
Coroutines in Kotlin. UA Mobile 2017.
Coroutines in Kotlin. UA Mobile 2017.Coroutines in Kotlin. UA Mobile 2017.
Coroutines in Kotlin. UA Mobile 2017.
 
Arduino for Beginners
Arduino for BeginnersArduino for Beginners
Arduino for Beginners
 
JUDCon London 2011 - Bin packing with drools planner by example
JUDCon London 2011 - Bin packing with drools planner by exampleJUDCon London 2011 - Bin packing with drools planner by example
JUDCon London 2011 - Bin packing with drools planner by example
 
Actor Concurrency
Actor ConcurrencyActor Concurrency
Actor Concurrency
 
Test Infected Presentation
Test Infected PresentationTest Infected Presentation
Test Infected Presentation
 
Fine-grained Processing of CVS Archives with APFEL
Fine-grained Processing of CVS Archives with APFELFine-grained Processing of CVS Archives with APFEL
Fine-grained Processing of CVS Archives with APFEL
 
15,000 downloads in 15 days with David Neumann and Thomas Ang
15,000 downloads in 15 days with David Neumann and Thomas Ang15,000 downloads in 15 days with David Neumann and Thomas Ang
15,000 downloads in 15 days with David Neumann and Thomas Ang
 
Android wearpp
Android wearppAndroid wearpp
Android wearpp
 
The Ring programming language version 1.10 book - Part 95 of 212
The Ring programming language version 1.10 book - Part 95 of 212The Ring programming language version 1.10 book - Part 95 of 212
The Ring programming language version 1.10 book - Part 95 of 212
 
Creating Asha Games: Game Pausing, Orientation, Sensors and Gestures
Creating Asha Games: Game Pausing, Orientation, Sensors and GesturesCreating Asha Games: Game Pausing, Orientation, Sensors and Gestures
Creating Asha Games: Game Pausing, Orientation, Sensors and Gestures
 
Clean & Typechecked JS
Clean & Typechecked JSClean & Typechecked JS
Clean & Typechecked JS
 
Beyond simple benchmarks—a practical guide to optimizing code
Beyond simple benchmarks—a practical guide to optimizing code Beyond simple benchmarks—a practical guide to optimizing code
Beyond simple benchmarks—a practical guide to optimizing code
 
Tony jambu (obscure) tools of the trade for tuning oracle sq ls
Tony jambu   (obscure) tools of the trade for tuning oracle sq lsTony jambu   (obscure) tools of the trade for tuning oracle sq ls
Tony jambu (obscure) tools of the trade for tuning oracle sq ls
 
Eff Plsql
Eff PlsqlEff Plsql
Eff Plsql
 
Arduino Section Programming - from Sparkfun
Arduino Section Programming - from SparkfunArduino Section Programming - from Sparkfun
Arduino Section Programming - from Sparkfun
 

Recently uploaded

%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
masabamasaba
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
masabamasaba
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
chiefasafspells
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 

Recently uploaded (20)

%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaS
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
 
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
 
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 

Release your software anytime - feature toggles