What is a Feature Flag?

📘

Feature flags allow you to manage deployments and actual releases separately.

As soon as you deploy your code into production, the relevant features become visible to users. This moment of deployment is the most stressful stage for developers. This is because we often encounter situations where unexpected problems arise from untested, or even tested situations.

Feature flags allow you to manage the entire lifecycle of a feature by separating deployment from actual release.

For example:

  • You can test in a production environment by allowing only a few designated users to gain access to the deployed feature without exposing the feature to all users right away.
  • You can enable or disable the feature from being seen at any time after deployment.

Teams that require feature flags

Feature flags are the most recommended feature for developers, but they aren't just for developers.

  • Planners/PM/POs who want to gradually release features
  • QAs who wants to test in a specific environment before a feature release
  • System administrators who want to manage and control system functions by turning specific system functions on and off whenever they want

Examples of feature flag usage

Manage feature releases

You can reduce deployment complexity in situations where there are multiple changes being deployed. You can focus on deployment without affecting other features, services, and operating environments by introducing a feature flag for each feature or service at an OFF state and starting the deployment. After the deployment is complete, you can start switching the feature flags to the ON state one by one and easily monitor all the features.

The advantages in this case are:

  • Certain features can be released first, which means the possible negative impacts of a certain feature can be identified within a low risk.
  • Certain features can be released first, making internal testing easier.
  • There is no need to coordinate the deployment time with the developer responsible for each new feature or service, allowing for the flexibility of time.

Gradual release

You can roll out a feature to a specific user first before rolling it out to all users. These users may include QA, beta testers, etc from your team. You can also start with an unspecified majority at low traffic and gradually roll out features to all users over time.

The advantages in this case are:

  • Since the function is released to some users first, the impact level can be identified within a low risk.
  • Get feedback from users and make changes if necessary.
  • If there is a problem with a function, you can immediately disable the function.

System stability management

You can turn system features on and off without deploying code to maintain system stability.

  • If there is a lot of traffic, you can block the traffic for the stability of the server.
  • You can control traffic to existing and new servers in cases of migration to new servers, databases, etc.