Feature flags are becoming a prominent part of DevOps practices and for good reason. They allow you to turn features in your live application on or off without redeploying code. You might think that something so powerful would require some rocket science-level programming to implement, but you'd be surprised to know that, at their core, feature flags are booleans and if-then-else statements.
Okay, that's an oversimplification of things, but it's true. And while there are different ways of implementing feature flags, they all share this common core. That said, let's take a broader look at feature flags and their uses in modern software development.
Use Cases in Software Development and Delivery
Orchestrating Gradual Feature Rollouts
Organizations can use feature flags to roll out features to users incrementally. Using feature flags, they can release a new feature to a subset of users, receive feedback, and work on it. Once they fix all issues, they can finally release it to a broader subset of the users or all users. Feature flags make canary releases, beta testing, and blue-green deployments easier.
Conducting Product Experiments
Sometimes we might need to test small improvements to our software before rolling them out. To increase sales, we might need to improve marketing strategies by redesigning landing pages and UI components or rewriting copy. This is where feature flags come in. Feature flags allow organizations to test out changes on users, empowering them to perform experiments like A/B testing. After analyzing the impact of these changes, they can use the results of the experiments and other related data to improve their products and their businesses as a whole.
Enhancing Application Reliability
When new features go into production, they can behave unexpectedly despite going through testing. To minimize such risks, feature flags can be used to disable new features immediately after any issues arise. The development team can then investigate the issues, work on a fix and roll it out when it's ready.
Another use of feature flags in operations is the kill switch, which is used to turn off software components during infrastructure maintenance or when experiencing high amounts of traffic. Whenever the traffic goes back to normal levels, the kill switch can be turned off, and normal operations can resume.
Handling User Permissions and Entitlements
Organizations can use feature flags to enable special features for their customers and employees through user targeting. This can empower non-developers like product or sales managers to use feature flags without going through the developers. They can use feature flags to showcase new features to customers and upper management so they can keep them up-to-date with the latest developments. Check out this article for more on how non-developers use feature flags.
Feature Flag Management
So far, we've seen the benefits of feature flags, but what about the downsides? Feature flags are tools, and just like any tool, they can be used or misused. Because they have so many potential use cases, it's common for organizations to use many feature flags at a time. So how should they manage them to avoid technical debt? Here are a few feature flag management best practices:
- Use consistent naming conventions.
- Remove any stale (zombie) flags.
- Remove references of unused flags from your codebase.
Implementing feature flag management practices can be difficult, especially when using a custom-built feature flagging solution. If you use a dedicated feature flag management platform like ConfigCat, you can easily handle all the problems that come with managing feature flags. Here are some benefits of using ConfigCat to manage your feature flags:
- Get visibility of your feature flags by having them in one place.
- Add descriptions, tags, and case styles to document and organize your feature flags.
- Get notified of any feature flags you no longer use to help you avoid tech debt.
- Keep track of the locations of feature flags in your codebase with ConfigCat's Code references feature.
There is much more to ConfigCat than just managing feature flags. More importantly, ConfigCat offers different user targeting and segmentation options for testing and releasing features to specific users.
It might be helpful to think of feature flags as just booleans or switches. But in reality, they're much more than that. As organizations scale, having feature flags in their development infrastructure will enable them to keep up with the fast-paced world of software delivery.
Here are some key points to take away from this article:
- Feature flags can be used to conduct experiments, slowly roll out releases to users, enable features for specific users, and control the operational behavior of applications.
- Feature flags can cause technical debt to accumulate if not handled correctly.
- Feature management platforms are the best choice for solving feature flag management problems and providing features that allow organizations to get the most out of feature flags.
Looking for a feature flag platform to use? Try out ConfigCat. ConfigCat has a free-forever plan with a generous amount of features. It's a good fit for those starting out and those using feature flags on a small scale.