Best practices for feature flagging
February 14, 2024
Back to homeTypes of Tags
Short Term Flags |
Permanent Flags |
Limited Lifespan |
Entitlements |
Clear Purpose |
Circuit Breakers |
A/B Testing Segments |
Load Shedding |
New Services Rollout |
White labeling |
Release Kill Switch |
Accessibility |
Operational Flags — “An operational interaction flag is controlled by the ops team to protect the systems”
Release Flag — “A release flag is controlled by the product or business owner to control how user adoption progresses.”
White-labeling Flag — “Configuring the look and feel of an application for each client.”
Circuit breakers/Load-shedding — “Having the ability to quickly turn a feature off or terminate a connection when problems arise prevents problems from impacting all users.”
So what are some of the best practices for usage?
- Standardized Naming
- Be Descriptive
- Its good to be Verbose
- Is the flag TEMP or PERM?
- Release Flags get a date stamp for the date of release/toggle 02232020
- Tag the business name who owns the flag, more important in a shared codebase like CB
- Minimize the flag footprint
- Flag should not control more than one feature or action
- If multiple features depend on each other you can flag each and then also a master flag for all features
- Permanent Flags
- Use user permissions and groups to control access to types of flags based on user and tag
- Proper naming will help take pressure off the clean-up process
- Can use tags to assign user permissions to specific types of flags
- Tag your permanent flags as such
- Short-term Flags
- Use user permissions and groups to control access to types of flags based on user and tag
- Have a plan to clean up the flag before you create it
- Use user permissions and groups to control access to types of flags based on user
- Add date of toggle to the name, so we know the flag can be removed after that date
- Clearly naming the feature in common language
- Clean-up Event
- Capture the Flag Day — All teams work to remove feature flags safely at the same time. Person with the most removals, wins.
- Schedule a monthly/bi-weekly cleanup
- Review list of Flags regularly
- Has the same variation been served for a long time?
- Is the flag permanent, and if so, does its purpose still make sense?
- Is the flag temporary, and has the event date passed?
General Guidelines
- Keep the number of flags as low as possible in the system at any given time (more flags = more complexity)
- Keep the flags as short lived as possible
- Be descriptive and Verbose with your Flag Names\
Some further reading…
https://launchdarkly.com/blog/best-practices-short-term-permanent-flags/
https://medium.com/@thysniu/coding-with-feature-flags-how-to-guide-and-best-practices-3f9637f51265