SlideShare a Scribd company logo
Feature Toggles
Minni Arora
Introduction
Feature toggles are a powerful technique, allowing teams to modify system
behavior without changing code.
It is a binary condition that controls whether a feature appears in the app or not.
Example
Feature
Toggling
context
Toggle
configuration
Toggle
router
function apply() {
if (featureIsEnabled("newApply")) {
return applyWithNewAlgorithm();
} else {
return oldFashionedApply();
}
}
Toggle point
Categories
● Release toggles
● Operational toggles
● Experiment toggles
● Permission toggles
Configuration Management
● Hardcoded
○ // return applyWithNewAlgorithm();
○ return oldFashionedApply();
● Parameterized: command line, environment vars
● In files
● In database. Accompanied with admin UI
● Distributed: zookeeper, etcd, consul etc...
Implementation
Harcoded
❏ Rigid
❏ Requires manual intervention
❏ Can’t be automated
❏ Error prone
❏ Requires redeployment
class Apply {
………..
// return newApply();
return oldApply();
}
Point Toggles
class Apply {
……….
// fetch config from somewhere
………..
if(config.newApply) {
// go to new apply
}
else {
// go to old apply
}
}
Point Toggles
❏ One feature, many toggle points
❏ Decision point coupled with decision logic
❏ Messy code that is difficult to maintain
❏ Lacks separation of concerns
❏ Difficult to incorporate toggle scope
changes
class Apply {
// fetch config from somewhere
……
if(config.newApply) {
// go to new apply
}
else {
// go to old apply
}
……
…...
if(config.newApply) {
// do something
}
else {
// do something else
}
……..
}
Indirection
❏ One extra concept that Apply is aware of
❏ Coupling with an extra module
❏ Can’t think of Apply in isolation
❏ More and more modules get coupled with
feature toggle system
❏ Feature toggle system becomes a global
dependency
❏ Unwanted proliferation of conditionals
class FeatureDecisions {
// fetch config
public void isNewApply() {
return config.newApply;
}
}
class Apply {
// read isNewApply() from FeatureDecisions
if(isNewApply()) {
// go to new apply
}
else {
// go to old apply
}
}
Remove conditionals
❏ Strategic creation of objects
❏ Dependencies injected
❏ Easy to add and remove toggles
❏ Apply is unaware of feature toggle system
❏ Encapsulates if/else statements into the
routing layer
class FeatureFactory {
…...
if(featureDecisions.isNewApply()) {
new Apply (new ApplyWithNewAlgo());
}
else {
new Apply (new OldFashionedApply());
}
}
Keep inventory low
● Remove toggles that are no longer needed
● Remove dead code
● Limit the number of toggles
● Don’t create technical debt
Thank You
https://martinfowler.com/articles/feature-toggles.html

More Related Content

DOC
PDF
Grasping dataset
PPTX
Stored procedure in sql server
PPTX
React hooks
PPTX
Mysql creating stored function
PPTX
Oracle: Cursors
PPT
Design Patterns
Grasping dataset
Stored procedure in sql server
React hooks
Mysql creating stored function
Oracle: Cursors
Design Patterns

What's hot (18)

PDF
Understanding react hooks
PDF
React new features and intro to Hooks
PPTX
Sql Functions And Procedures
PPTX
Meetup - Singleton & DI/IoC
PPTX
Introduction to triggers
PPTX
PPTX
React hooks
PPTX
Procedures and triggers in SQL
PPT
Core java day4
PPS
Procedures/functions of rdbms
PDF
Deep Dive into React Hooks
PDF
Effective Unit Test Style Guide
PPT
KMUTNB - Internet Programming 6/7
PPT
Krazykoder struts2 interceptors
PDF
SQL Subqueries - Oracle SQL Fundamentals
PDF
All about unit testing using (power) mock
PPTX
Power mock
PPTX
Data structures
Understanding react hooks
React new features and intro to Hooks
Sql Functions And Procedures
Meetup - Singleton & DI/IoC
Introduction to triggers
React hooks
Procedures and triggers in SQL
Core java day4
Procedures/functions of rdbms
Deep Dive into React Hooks
Effective Unit Test Style Guide
KMUTNB - Internet Programming 6/7
Krazykoder struts2 interceptors
SQL Subqueries - Oracle SQL Fundamentals
All about unit testing using (power) mock
Power mock
Data structures
Ad

Viewers also liked (20)

PDF
[@NaukriEngineering] BDD implementation using Cucumber
PPTX
Naukri.com
PDF
Bdd using Cucumber
PPTX
Introduction to Feature Toggle and FF4J
PDF
Bdd training v5.2.0 - public
PPTX
Why we used Feature Branching
PDF
The LAZY Developer's Guide to BDD (with Cucumber)
PPTX
Feature Toggles
ODP
Mock Aren't Stub 讀後心得
PDF
BDD and Test Automation in Evalutionary Product Suite
PDF
BDD com Cucumber
PPTX
Feature Toggle XP Conference 2016 Kalpana Gulati
PPTX
Naukri.com
PDF
Feature Toggle
PDF
BDD in Action – principles, practices and real-world application
PPTX
Feature toggles
PDF
[@NaukriEngineering] Git Basic Commands and Hacks
PPTX
BDD testing with cucumber
PPTX
BDD presentation
PPT
Behavior Driven Development (BDD) and Agile Testing
[@NaukriEngineering] BDD implementation using Cucumber
Naukri.com
Bdd using Cucumber
Introduction to Feature Toggle and FF4J
Bdd training v5.2.0 - public
Why we used Feature Branching
The LAZY Developer's Guide to BDD (with Cucumber)
Feature Toggles
Mock Aren't Stub 讀後心得
BDD and Test Automation in Evalutionary Product Suite
BDD com Cucumber
Feature Toggle XP Conference 2016 Kalpana Gulati
Naukri.com
Feature Toggle
BDD in Action – principles, practices and real-world application
Feature toggles
[@NaukriEngineering] Git Basic Commands and Hacks
BDD testing with cucumber
BDD presentation
Behavior Driven Development (BDD) and Agile Testing
Ad

Similar to [@NaukriEngineering] Feature Toggles (20)

PDF
Preparando nossa aplicação para falhar com feature toggle e configurações dis...
PDF
apidays Paris 2022 - Agile API delivery with Feature Toggles, Rafik Ferroukh,...
PDF
Feature toggling
PDF
From MVP to a Product
PDF
Feature Toggles On Steroids
PPTX
devops certification
PPTX
devops certification
PDF
Preparando nossas aplicações para falharem com feature toggle e configurações...
PDF
Tell Me Quando - Implementing Feature Flags
PDF
Trunk based development
PDF
Александр Махомет "Feature Flags. Уменьшаем риски при выпуске изменений"
PDF
Feature Flags. Reducing risks during shipping changes/
KEY
AngularJS for designers and developers
PPTX
Old code doesn't stink
PDF
Feature flagsareflawed
PDF
Feature Flags Are Flawed: Let's Make Them Better - DPC
PDF
Feature Flags Are Flawed: Let's Make Them Better
PDF
Feature Flags.pdf
PDF
Clean code in JavaScript
PPTX
Old code doesn't stink - Detroit
Preparando nossa aplicação para falhar com feature toggle e configurações dis...
apidays Paris 2022 - Agile API delivery with Feature Toggles, Rafik Ferroukh,...
Feature toggling
From MVP to a Product
Feature Toggles On Steroids
devops certification
devops certification
Preparando nossas aplicações para falharem com feature toggle e configurações...
Tell Me Quando - Implementing Feature Flags
Trunk based development
Александр Махомет "Feature Flags. Уменьшаем риски при выпуске изменений"
Feature Flags. Reducing risks during shipping changes/
AngularJS for designers and developers
Old code doesn't stink
Feature flagsareflawed
Feature Flags Are Flawed: Let's Make Them Better - DPC
Feature Flags Are Flawed: Let's Make Them Better
Feature Flags.pdf
Clean code in JavaScript
Old code doesn't stink - Detroit

More from Naukri.com (16)

PDF
[@NaukriEngineering] Deferred deep linking in iOS
PDF
[@NaukriEngineering] Instant Apps
PPTX
[@NaukriEngineering] Video handlings on apple platforms
PDF
[@NaukriEngineering] Introduction to Android O
PDF
[@NaukriEngineering] MVVM in iOS
PDF
[@NaukriEngineering] Introduction to Galera cluster
PDF
[@NaukriEngineering] Inbound Emails for Every Web App: Angle
PDF
[@NaukriEngineering] Apache Spark
PDF
[@NaukriEngineering] Icon fonts & vector drawable in iOS apps
PDF
[@NaukriEngineering] AppTracer
PDF
[@NaukriEngineering] Flux Architecture
PDF
[@NaukriEngineering] Mobile Web app scripts execution using Appium
PDF
[@NaukriEngineering] Messaging Queues
PDF
[@NaukriEngineering] Docker 101
PDF
[@NaukriEngineering] IndexedDB
PDF
[@NaukriEngineering] CSS4 Selectors – Part 1
[@NaukriEngineering] Deferred deep linking in iOS
[@NaukriEngineering] Instant Apps
[@NaukriEngineering] Video handlings on apple platforms
[@NaukriEngineering] Introduction to Android O
[@NaukriEngineering] MVVM in iOS
[@NaukriEngineering] Introduction to Galera cluster
[@NaukriEngineering] Inbound Emails for Every Web App: Angle
[@NaukriEngineering] Apache Spark
[@NaukriEngineering] Icon fonts & vector drawable in iOS apps
[@NaukriEngineering] AppTracer
[@NaukriEngineering] Flux Architecture
[@NaukriEngineering] Mobile Web app scripts execution using Appium
[@NaukriEngineering] Messaging Queues
[@NaukriEngineering] Docker 101
[@NaukriEngineering] IndexedDB
[@NaukriEngineering] CSS4 Selectors – Part 1

Recently uploaded (20)

PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PDF
Well-logging-methods_new................
PPTX
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PDF
composite construction of structures.pdf
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PPTX
web development for engineering and engineering
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PDF
Arduino robotics embedded978-1-4302-3184-4.pdf
PPTX
Construction Project Organization Group 2.pptx
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PPTX
UNIT 4 Total Quality Management .pptx
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
CYBER-CRIMES AND SECURITY A guide to understanding
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
Well-logging-methods_new................
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
Embodied AI: Ushering in the Next Era of Intelligent Systems
Operating System & Kernel Study Guide-1 - converted.pdf
composite construction of structures.pdf
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
web development for engineering and engineering
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
Arduino robotics embedded978-1-4302-3184-4.pdf
Construction Project Organization Group 2.pptx
UNIT-1 - COAL BASED THERMAL POWER PLANTS
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
UNIT 4 Total Quality Management .pptx
Model Code of Practice - Construction Work - 21102022 .pdf
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...

[@NaukriEngineering] Feature Toggles

  • 2. Introduction Feature toggles are a powerful technique, allowing teams to modify system behavior without changing code. It is a binary condition that controls whether a feature appears in the app or not.
  • 3. Example Feature Toggling context Toggle configuration Toggle router function apply() { if (featureIsEnabled("newApply")) { return applyWithNewAlgorithm(); } else { return oldFashionedApply(); } } Toggle point
  • 4. Categories ● Release toggles ● Operational toggles ● Experiment toggles ● Permission toggles
  • 5. Configuration Management ● Hardcoded ○ // return applyWithNewAlgorithm(); ○ return oldFashionedApply(); ● Parameterized: command line, environment vars ● In files ● In database. Accompanied with admin UI ● Distributed: zookeeper, etcd, consul etc...
  • 7. Harcoded ❏ Rigid ❏ Requires manual intervention ❏ Can’t be automated ❏ Error prone ❏ Requires redeployment class Apply { ……….. // return newApply(); return oldApply(); }
  • 8. Point Toggles class Apply { ………. // fetch config from somewhere ……….. if(config.newApply) { // go to new apply } else { // go to old apply } }
  • 9. Point Toggles ❏ One feature, many toggle points ❏ Decision point coupled with decision logic ❏ Messy code that is difficult to maintain ❏ Lacks separation of concerns ❏ Difficult to incorporate toggle scope changes class Apply { // fetch config from somewhere …… if(config.newApply) { // go to new apply } else { // go to old apply } …… …... if(config.newApply) { // do something } else { // do something else } …….. }
  • 10. Indirection ❏ One extra concept that Apply is aware of ❏ Coupling with an extra module ❏ Can’t think of Apply in isolation ❏ More and more modules get coupled with feature toggle system ❏ Feature toggle system becomes a global dependency ❏ Unwanted proliferation of conditionals class FeatureDecisions { // fetch config public void isNewApply() { return config.newApply; } } class Apply { // read isNewApply() from FeatureDecisions if(isNewApply()) { // go to new apply } else { // go to old apply } }
  • 11. Remove conditionals ❏ Strategic creation of objects ❏ Dependencies injected ❏ Easy to add and remove toggles ❏ Apply is unaware of feature toggle system ❏ Encapsulates if/else statements into the routing layer class FeatureFactory { …... if(featureDecisions.isNewApply()) { new Apply (new ApplyWithNewAlgo()); } else { new Apply (new OldFashionedApply()); } }
  • 12. Keep inventory low ● Remove toggles that are no longer needed ● Remove dead code ● Limit the number of toggles ● Don’t create technical debt