What is a feature flag and why are feature flags used?
Feature flags allow you to release, test, and manage features and functionality across your application without changing the source code. Organizations use added control and flexibility to deliver more and higher quality features with reduced cost, time, and risk.
In this guide, we’ll introduce you to the basics of feature flags and why so many development teams choose them.
Why developers use feature flags
The easiest way to explain why developers use feature flags is to understand the story of why Ivar Østhus, our CTO, created the Unleash feature flag service in the first place. Here's Ivar in his own words:
In 2014, I was working as a software developer at FINN.no, Norway’s largest online marketplace. Getting new features into production was a pain, so, as a developer, I looked around and wondered if I could write some code to make it easier. My initial goal was to protect features under development, allowing our team to transition to trunk-based development—a practice recommended according to the State of DevOps Report.
Even back at that time, we embraced agility with an automated delivery pipeline which made fixing bugs a breeze, but frequent feature releases? Not so much. Building features takes time, and waiting weeks for production testing felt wasteful. We used feature branches, a common approach, to isolate unfinished features. However, this created a tangled web of problems:
- Limited feedback: Getting stakeholder input required manually deploying test environments for each branch, a cumbersome process.
- Merge mayhem: Conflicts became a constant headache, delaying progress.
- Production mystery: Would a change actually work in production with production data? Were there any edge cases we had not considered?
Frustrated by the slow pace and the additional complexity of feature branches, I explored ways to streamline the development process through code. This is how I ended up creating Unleash, a popular open-source feature flag solution that solves these problems by decoupling code deployments and feature releases.
What is a feature flag?
A feature flag is a software engineering technique that turns features or functionality on or off without modifying the source code or requiring a redeploy. It’s also referred to as feature toggles, switches, flippers, or bits.
Feature flags enable you to release and test new features by making them available to a specific group of users, or no users at all, with the power to immediately turn them off without any risk to the rest of your application.
The control that feature flags allow means that they’re already becoming a popular superpower in feature lifecycle management. Combined with feature management platforms and processes, they can enable a cultural shift within organizations towards more agile and experimental development and ways of serving users.
.
Benefits of feature flags
With an understanding of what feature flags are, let’s look at the key benefits of using feature flags, such as improved user experience, faster release cycles, and more effective testing and experimentation.
Improve user experience
Feature flags give you more control over what is released, to whom, and when. This means you have more control over the user experience of your end product. Instead of making release decisions based mostly on operational constraints and risk fears, you have the control to make features available based on what makes the most sense for specific users as well as your business goals. For example, releases can be timed to align with marketing campaigns, customer support, and product marketing efforts.