DevOps: Using Feature Flags to optimize  product deployment

DevOps: Using Feature Flags to optimize product deployment

As Agile and Lean management become increasingly popular with engineering teams and more companies build with iterative product development, it makes sense that techniques to support these endeavors are adopted.

In a previous post, I talked about the workflow of the CI/CD pipeline and how it enables developers to deploy quality products at faster rates.

For this article, the focus is on Feature Flags, which is a crucial technique used in the deployment stage of a product’s lifecycle.

What are Feature Flags?

You can think of Feature flags as a tool that developers use to toggle product features on and off for a particular set of users.

Feature flags can be used for a controlled rollout to users

Multiple features can be wrapped in feature flags depending on the use case of the developers at the time.

In code terms, a feature flag is an if-else statement that activates or deactivates a particular product feature.

What is the essence of feature flags?

As much as developers endeavour to push quality code into production, this doesn’t negate the existence of bugs and product malfunctions post-deployment.

Features may not work as intended, users may have negative feedback or you might be experimenting which new features in your product roadmap.

Feature flags enable you to wrap these features in a feature flag, to have more control over their rollout.

Use cases of Feature flags

Continuous Deployment

Developers who leverage CI/CD pipelines build products feature by feature continuously.

Of course, because a feature made it to production, doesn’t equate that it is ready to be rolled out to the entire user base.

Feature flags can be used to turn off the functionality of a deployed feature until the developers are certain they are ready to be released.

Product Testing

The product roadmap evolves as different circumstances come into view.

Customers can have new feature requests, and new technology or markets may emerge which can present opportunities for the existing product to evolve.

Feature flags go hand in hand with experiment-driven product development(XDPD) as you can adapt to the evolving business environment by testing new features with your power users (or early adopters).

This way you gain feedback and actionable data that influence product quality and business growth.

Service Outage

Product malfunctions can be chaotic, especially during peak times of usage.

Emails are flying in, support phones are ringing and there may even be some buzz on social media about your product being down.

You can use feature flags for a controlled shutdown of your product.

With the functionality turned off, bugs can be fixed in an organized approach and features can be tested for quality assurance before making them available again for users.

Just don’t forget to send those push notifications during service outages to avoid a negative company image :)

Maintenance

Piggybacking from the last point, feature flags can also be used to take products offline for maintenance purposes.

This time, you’re taking a preventive approach rather than a reactive one.

After maintenance, the product can be active again for your users.

Again, informing the audience about maintenance efforts affecting product usage is important.

Conclusion

Happy Shipping :)