[{"data":1,"prerenderedAt":507},["ShallowReactive",2],{"post-en-2022-05-13-feature-flags":3},{"post":4,"newer":500,"older":503,"hasTranslation":506},{"id":5,"title":6,"body":7,"cardImg":475,"date":476,"description":477,"excerpt":478,"extension":479,"figCaption":475,"img":480,"lang":481,"listed":482,"meta":483,"navigation":482,"path":494,"readingTime":250,"seo":495,"slug":496,"stem":497,"tagList":498,"__hash__":499},"posts\u002Fposts\u002Fen\u002F2022-05-13-feature-flags.md","Feature flag? What is it for?",{"type":8,"value":9,"toc":458},"minimark",[10,14,17,27,36,39,44,51,54,75,78,81,85,88,99,102,116,119,122,133,136,144,148,154,160,163,167,172,176,184,188,193,199,206,210,230,233,242,245,248,254,257,269,272,278,284,288,329,333,353,370,374,391,398,407,413,417,424,426,430],[11,12,13],"p",{},"One of the topics i’ve heard recurring in my podcast is Feature Flags. It is not a complete post for learning, but just penning down whatever i’ve learnt the past week.",[11,15,16],{},"Questions:",[18,19,20,24],"ol",{},[21,22,23],"li",{},"when should you not use feature flags?",[21,25,26],{},"How to actual implement feature flags",[11,28,29,30],{},"Ive also found an artticle with good content to share with my readers: ",[31,32,33],"a",{"href":33,"rel":34},"https:\u002F\u002Flaunchdarkly.com\u002Fblog\u002Fwhat-are-feature-flags\u002F",[35],"nofollow",[37,38],"hr",{},[40,41,43],"h2",{"id":42},"definition-of-feature-flags","Definition of feature flags",[11,45,46,47,50],{},"A software development process used to nebale or disable functionalities remotely without deploying code. New features can be deployed without making them visible to users.",[48,49],"br",{},"\nfeature flags help to decouple deployment from release letting you manage the full lifecycle of a feature.",[11,52,53],{},"It has many names:",[55,56,57,60,63,66,69,72],"ul",{},[21,58,59],{},"Feature toggle",[21,61,62],{},"Feature flipper",[21,64,65],{},"Feature switch",[21,67,68],{},"Conditional feature",[21,70,71],{},"Feature controls",[21,73,74],{},"Release toggle",[11,76,77],{},"If you want to release the feature only for employees using their corporate emails, that can be achieved using feature flags.",[11,79,80],{},"Feature flags eliminate the need to maintain multiple feature branches within your source code. All changes can be done to the primary branch, only whent he feature is ready then it will be enabled by default, and once its stable, you should consider removing the feature flag entirely.",[40,82,84],{"id":83},"who-uses-feature-flag","Who uses feature flag?",[11,86,87],{},"Feature flags are built primarily for non-tech usages. Engineers are creating switches for you as non-tech to toggle and give you more control over the application.",[55,89,90,93,96],{},[21,91,92],{},"Sales and Customer Support to provision entitlements",[21,94,95],{},"Product Management to manage beta programs",[21,97,98],{},"Marketing to run A\u002FB testing",[11,100,101],{},"Ideally, the use of feature flag helps with:",[55,103,104,107,110,113],{},[21,105,106],{},"reduce the number of code rollback",[21,108,109],{},"Gradually rollout new functionalities to users",[21,111,112],{},"minimize the risk of a release by first releasing to small groups of users.",[21,114,115],{},"test user acceptance",[11,117,118],{},"If you want to consider reducing your time to deployment, companies rely on feature flag management to gradually roll out features to users. Continuous delivery is the ability to shorten release cycles and get new functionalites in the user’s hands quickly and safely.",[11,120,121],{},"Safely has a few contexts:",[55,123,124,127,130],{},[21,125,126],{},"release to gain confidence in your new feature to work in production",[21,128,129],{},"release to a smaller group of people for a start to incrementally gain confidence.",[21,131,132],{},"allow the feature to be switched off if the feature encounters an issue.",[11,134,135],{},"Progressive Delivery allows fine-grained control over rollout and ownership of a feature. Progressive Delivery includes user segmentation, traffic management, observability, and automation to release features to small portions of user.",[55,137,138,141],{},[21,139,140],{},"If you have a library that allows the switching on\u002Foff of a feature, that is merely subset of the Progressive Delivery framework.",[21,142,143],{},"you have to consider traffic management, User segmentation and how you can observe the performance of enabled features.",[40,145,147],{"id":146},"why-use-feature-flags","Why use feature flags",[11,149,150,151,153],{},"Based on DevOps report, characteristics of high performing orgasnisations includes quicker deployment time and low rollback %",[48,152],{},"\nhigh performing teams deploy code 46x more frequently with a lead time from commit to deploy 2,555 times faster. They are deploying code faster and they fail less frequently. High-performing teams have a lower change failture rate and recover from incidents faster.",[11,155,156,157,159],{},"Creating a CI\u002FCD pipeline is necessary to increase the velocity of code deployments.",[48,158],{},"\nIf you want to enable trunk-base development for your company, you have to consider feature flags so new feature’s code can be pushed into a single branch (typically Master branch), without having it enabled. Trunk based development helps to eliminate merge conflicts, broken builds and thus have a cleaner codebase.",[11,161,162],{},"Instead of a feature branch, use a flag to gate features not ready for public viewing.",[40,164,166],{"id":165},"when-to-use-feature-flags","When to use feature flags",[18,168,169],{},[21,170,171],{},"Improve feature rollout",[40,173,175],{"id":174},"where-feature-flags-make-a-difference","Where feature flags make a difference?",[55,177,178,181],{},[21,179,180],{},"If you want fast deployments.",[21,182,183],{},"If you want to give non-technical personnel control over features",[40,185,187],{"id":186},"how-are-feature-flags-deployed","How are feature flags deployed?",[18,189,190],{},[21,191,192],{},"Manage all your feature flag naming in a single place",[11,194,195,196,198],{},"Create a class and create classes for it to be called in the application layer.",[48,197],{},"\nNeed to understand this part",[11,200,201,202],{},"Reference: ",[31,203,204],{"href":204,"rel":205},"https:\u002F\u002Fmartinfowler.com\u002Farticles\u002Ffeature-toggles.html",[35],[40,207,209],{"id":208},"best-practices","Best practices",[18,211,212,215,224],{},[21,213,214],{},"Choose the right level of flagging",[21,216,217,218,220,221,223],{},"Flag naming",[48,219],{},"\nRemove a flag once the rollout feature flag has served its purpose.",[48,222],{},"\nalways name your flags ending with “_enabled”",[21,225,226,227,229],{},"Set up logging",[48,228],{},"\nGive yourself visibility on who toggled the feature flags. If you want to give everyone access rights to feature flags, you need to then trhttps:\u002F\u002Ffeatureflags.io\u002Ffeature-flags-uses\u002F for audit purpose.",[11,231,232],{},"Audit and access control: who can change the flags and track who changed the flags.lau",[18,234,236],{"start":235},4,[21,237,238,239,241],{},"Give access to non-technical users",[48,240],{},"\nMost effective when put into product team, QA team to control.",[11,243,244],{},"It can foster rollout thinking.",[11,246,247],{},"Allow feature flags to be toggled on run time via some form of admin UI",[18,249,251],{"start":250},5,[21,252,253],{},"Control accesses to flag",[11,255,256],{},"Not all feature flags are easily available - especially the money generating ones",[18,258,260],{"start":259},6,[21,261,262,263,265,266,268],{},"Flag Status",[48,264],{},"\nIts to manage short and long term flags, and know when are these flags ready to be removed.",[48,267],{},"\nRemove flags once they have fulfilled their purpose, else it will grow to become technical debt.",[11,270,271],{},"Try to avoid feature flag hell. Having feature flags with unclear status, so you do not know when you should be removing them.",[18,273,275],{"start":274},7,[21,276,277],{},"Each feature should have their own flags",[11,279,201,280],{},[31,281,282],{"href":282,"rel":283},"https:\u002F\u002Fdevcycle.com\u002Fblog\u002Fdos-and-donts-of-feature-flags",[35],[40,285,287],{"id":286},"types-of-feature-flag","Types of feature flag",[18,289,290,302,308,314,320],{},[21,291,292,293,295,296,298,299,301],{},"Release flag",[48,294],{},"\nYou will need this for quick turnaround in CI\u002FCD environment.",[48,297],{},"\nYou can control % roll-out, user group configuration, geography configuration.",[48,300],{},"Using this is part of the CD’s requirements. You need in-progress features to be deployed to production. Allowing incomplete and untested codepaths to be shipped to production as latent code, which may never be turned on.",[21,303,304,305,307],{},"Experiment",[48,306],{},"\nFor A\u002FB testing, releasing new features to production to a small population of users. You can choose to release new UI feature to opted-in users.",[21,309,310,311,313],{},"entitltement\u002Faccess management",[48,312],{},"\nthis feature flag typically have longer lifecycle.",[21,315,316,317,319],{},"Ops Flag",[48,318],{},"\nkill-switch that offers graceful degration of the system under stress during peak load, but maintains essential features.",[21,321,322,323,325,326,328],{},"Bussiness flag",[48,324],{},"\nEnable or disable a feature based on time of the year. or geography.",[48,327],{},"\nExample: Enable free subscription for just a weekend.",[40,330,332],{"id":331},"use-cases","Use cases",[18,334,335,341,344,347,350],{},[21,336,337,338,340],{},"Canary Releasing",[48,339],{},"\nAllow the application to understand the concept of user cohorts. You only want to turn the new feature on for a small percentage of total user base - a ‘canary’ cohort",[21,342,343],{},"AB testing",[21,345,346],{},"Subscription",[21,348,349],{},"Maintenance Mode",[21,351,352],{},"Sunset features",[11,354,201,355,359,361,365,367],{},[31,356,357],{"href":357,"rel":358},"https:\u002F\u002Ffeatureflags.io\u002Ffeature-flags-uses\u002F",[35],[48,360],{},[31,362,363],{"href":363,"rel":364},"https:\u002F\u002Fwww.cloudbees.com\u002Fproducts\u002Ffeature-management\u002Fuse-cases\u002Fprogressive-delivery",[35],[48,366],{},[31,368,204],{"href":204,"rel":369},[35],[40,371,373],{"id":372},"existing-tools","Existing tools",[18,375,376,379,382,385,388],{},[21,377,378],{},"Launchdarkly",[21,380,381],{},"Rollout.io",[21,383,384],{},"Split.io",[21,386,387],{},"BulletTrain",[21,389,390],{},"Optimizely",[11,392,393],{},[31,394,397],{"href":395,"rel":396},"https:\u002F\u002Ffeatureflags.io\u002Fnode-js-feature-flags\u002F",[35],"NPM related libraries",[55,399,400],{},[21,401,402],{},[31,403,406],{"href":404,"rel":405},"https:\u002F\u002Fgithub.com\u002FFredKSchott\u002Ffflip",[35],"Flipit",[11,408,201,409],{},[31,410,411],{"href":411,"rel":412},"https:\u002F\u002Ftheproductmanager.com\u002Ftools\u002Fbest-feature-flag-software\u002F",[35],[40,414,416],{"id":415},"example-of-how-feature-flags-look-like","Example of how feature flags look like",[11,418,419],{},[420,421],"img",{"alt":422,"src":423},"Feature flag from Launch Darkly","https:\u002F\u002Fimages.prismic.io\u002Flaunchdarkly\u002Fdb0025e7-de69-4315-bc5e-31657b4176fc_what-are-feature-flags-intro.png?auto=compress,format",[37,425],{},[40,427,429],{"id":428},"references","References",[55,431,432,439,445,451],{},[21,433,434],{},[31,435,438],{"href":436,"rel":437},"https:\u002F\u002Fwww.peerislands.io\u002Ffeature-flags-for-rapid-development-and-continuous-delivery\u002F",[35],"Perrislands",[21,440,441],{},[31,442,444],{"href":204,"rel":443},[35],"Feature toggles",[21,446,447],{},[31,448,450],{"href":33,"rel":449},[35],"What are feature flags",[21,452,453],{},[31,454,457],{"href":455,"rel":456},"https:\u002F\u002Fcloud.google.com\u002Fblog\u002Fproducts\u002Fdevops-sre\u002Fthe-2019-accelerate-state-of-devops-elite-performance-productivity-and-scaling",[35],"Devops Report",{"title":459,"searchDepth":460,"depth":461,"links":462},"",2,3,[463,464,465,466,467,468,469,470,471,472,473,474],{"id":42,"depth":460,"text":43},{"id":83,"depth":460,"text":84},{"id":146,"depth":460,"text":147},{"id":165,"depth":460,"text":166},{"id":174,"depth":460,"text":175},{"id":186,"depth":460,"text":187},{"id":208,"depth":460,"text":209},{"id":286,"depth":460,"text":287},{"id":331,"depth":460,"text":332},{"id":372,"depth":460,"text":373},{"id":415,"depth":460,"text":416},{"id":428,"depth":460,"text":429},null,"2022-05-13","How can you deploy faster using feature flags?","One of the topics i've heard recurring in my podcast is Feature Flags. It is not a complete post for learning, but just penning down whatever i've learnt the past week…","md","https:\u002F\u002Fimages.unsplash.com\u002Fphoto-1556217994-22de7face210?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=2238&q=80","en",true,{"layout":484,"fig-caption":475,"tags":485},"post",[486,487,488,489,490,491,492,493],"engineers","https","messages","redis","support","web","websites","users","\u002Fposts\u002Fen\u002F2022-05-13-feature-flags",{"title":6,"description":477},"2022-05-13-feature-flags","posts\u002Fen\u002F2022-05-13-feature-flags",[486,487,488,489,490,491,492,493],"_M5bMQlbN5I6Ko2s1U7j2-dVBGRAHWgMUKZwZJwwZLc",{"slug":501,"title":502},"2022-06-01-month-of-may","May was a recalibration month",{"slug":504,"title":505},"2022-04-03-qa-in-startup","What do you think about QA in startup?",false,1794023764240]