Introducing feature flags
Feature flags (also called feature toggles) allow us to dynamically enable or disable a feature of an application without having to redeploy it.
Unlike 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 either for the running of the application or for an...