Feature flags (also called feature toggle) allow us to dynamically enable or disable a feature of an application without having to redeploy it.
Unlike the blue-green deployment with the canary release pattern, which is an architectural concept, feature flags are implemented in the application's code.
Their implementation is done with a simple encapsulation using conditional if rules, as shown in the following code example:
if(activateFeature("addTaxToOrder")==True) {
ordervalue = ordervalue + tax
}else{
ordervalue = ordervalue
}
In this example code, the activateFeature function allows us to find out whether the application should add the tax to order according to the addTaxToOrder parameter, which is specified outside the application (such as in a database or configuration file).
Features encapsulated in feature flags may be necessary...