Skip to main content
AG·SORA
Technology

Feature Flags and Gradual Rollouts: Releasing New Business App Features with Lower Risk

Published 9 min readWritten by agsora.tech
AG·SORA / BLOGAG·SORATechnologyFeature Flags and GradualRollouts: Releasing NewBusiness App Features withLower Riskagsora.tech
In this article

Releasing a new feature to a business application often feels like pressing one big button and hoping nothing breaks. Code is merged, deployed to the server, and instantly all users see the change. If there is a problem, the only way out is to redeploy the old version, which takes time and often happens at the least convenient hour. No wonder many teams choose to release rarely and in big packages, which makes each release even riskier.

Feature flags, or feature switches, and gradual rollouts offer another way: code is deployed at any time, but the new feature is only switched on for whom and when you decide. If there is a problem, the feature is switched off within seconds without redeploying anything. This article explains the concept in business language, the types of flags, gradual rollout patterns, the risks to manage, and how to start in your business application.

Summary

  • Feature flags separate two things that normally come together: deploying code to production and switching a feature on for users
  • Gradual rollout switches a feature on for a small group first, monitors the impact, then expands, so problems are detected before they hit everyone
  • A switch that can be turned off quickly is the best safeguard against mistakes that slipped past testing
  • Flags that are not cleaned up become technical debt, so every flag needs an owner, a purpose, and a removal date
  • Start with one risky feature, a simple switch, and clear monitoring, not with a big platform

The problem with one shot releases

In a traditional release, deploying code and showing a feature are one event. This creates several problems familiar to business application teams.

  • Risk piles up: because releases are rare, each carries many changes at once, and when something goes wrong it is hard to know which change is the cause
  • Slow recovery: rolling back means redeploying and retesting, while users keep experiencing the problem
  • Pressure on release hours: teams pick midnight or weekends to minimize impact, at the cost of fatigue and mistakes
  • Long lived code branches: features are worked on for weeks in separate branches, and the final merge is full of conflicts
  • Schedule dependence: a feature that is ready must wait for another that is not, because they ship in one package
  • No room to learn: all users receive the change at once, so there is no chance to check reactions before the impact spreads

For a business the consequences are real: service disruption in busy hours, customer complaints, and a team afraid to release so innovation slows.

A computer on a desk showing an interface and code on the screen
Feature switches let new code be deployed first, while when the feature shows to users is decided separately.

How a feature flag works

Conceptually, a feature flag is a simple branch inside the application: if this feature switch is on for this user, show the new behavior; if not, show the old behavior. The switch value is not embedded in the code but read from a setting that can be changed without redeploying the application, for example from a configuration table, a dedicated service, or a settings file that is reloaded.

As a result, the team can deploy the new feature's code to production before it is ready to be shown, leave it off, then switch it on in a controlled way. Deployment and launch become two separate decisions, and the second can be made by the product owner, not only by the developer.

Four types of flags with different lifespans

Not all flags are the same. Distinguishing them helps manage their lifecycle.

1. Release flags

Used to hide features that are unfinished or being launched gradually. Their lifespan is short: once the feature is switched on for everyone and is stable, the flag must be removed from the code.

2. Experiment flags

Used to test two variants on different groups of users and compare results, as in A/B testing and conversion optimization for business websites. Their lifespan is medium: they end when a decision is made based on data.

3. Operational flags

Used as emergency switches or load controls, for example turning off a heavy feature when traffic spikes or disabling a third party integration that is having problems. Their lifespan can be long, because they are meant as a permanent safeguard.

4. Permission or plan flags

Used to control which features are available by subscription plan or customer type, especially in multi tenant SaaS products. Their lifespan is long and they are really part of the product model, not a release tool. In a multi tenant architecture for SaaS products, this type is usually treated as plan configuration, separate from release flags.

Gradual rollout patterns

With a switch, features can be launched in several patterns that reduce risk.

  • Internal release: switch on only for employees or the testing team first, who often find the most glaring problems
  • Pilot users: switch on for a few willing, informed customers, often ones close to the team
  • Gradual percentage: 1 percent, 5 percent, 25 percent, 50 percent, then everyone, with a pause to monitor at each stage
  • By segment: per branch, per region, per plan, or per user type, suitable when impact differs between groups
  • Shadow or parallel: the new code runs in the background and its results are compared with the old code without affecting users, suitable for important calculations such as pricing or tax
  • Kill switch: the ability to switch the feature off instantly if indicators worsen

Choosing a pattern depends on risk. A small visual change can be switched on for everyone right away, while changes to price calculation, payment flow, or stock synchronization should go through stages with monitoring.

What to monitor during a gradual launch

A gradual rollout is only useful if you can see the impact. Set the indicators before switching on, not afterward.

  • Error and exception rates on the changed function, compared with the group that has not received it
  • Response time and server load, because new features are sometimes heavier than expected
  • Business indicators: checkout completion rate, number of orders, time to complete tasks, or number of support tickets
  • User feedback: complaints, comments, and tickets on related topics
  • Integration health: payments, shipping, and other systems that touch it

This is in line with the principles of observability, logging, and error handling: to compare groups that received the change and those that did not, logs and metrics need to record whether a request used the new or old behavior. Also set the threshold that triggers switching off, for example an error rise above a certain limit, and who is authorized to press the switch.

Rows of program code displayed large on a monitor screen
Monitoring that distinguishes new from old behavior makes the impact of each launch stage comparable.

Relation to testing and releases

Feature flags complement, not replace, testing. Automated testing and CI/CD make sure code works before deployment, while switches manage risk after deployment, under real conditions that cannot be fully imitated. Some things to remember:

  • Test both states: every flag doubles the code paths, so test behavior when on and when off, including when switched off after having been on
  • Be careful with database changes: a changed schema must be compatible with the old and new versions during the transition, so switching off a flag does not damage data
  • Flag combinations: when several flags depend on each other, the number of combinations grows fast, so limit simultaneously active flags and document dependencies
  • [User acceptance testing](/blog/uat-pengujian-sebelum-aplikasi-diluncurkan) is still needed, and flags make it easier because a feature can be switched on only for testers in the production environment

For mobile apps, remote switches are especially valuable because app store releases require review and users update on their own schedule. New features can be shipped inside the app first and switched on later, as discussed in the article on releasing an app to the App Store and Google Play. With a switch, a problematic feature can be turned off without waiting for a fixed version to be approved by the store.

Risks and how to manage them

Feature flags are not free. Some risks that often appear:

  • Forgotten flags: flags not removed after completion fill the code with dead branches, making it hard to read and test. This is a real form of [technical debt](/blog/utang-teknis-technical-debt-mengukur-dan-melunasinya)
  • Wrong configuration: a switch wrongly turned on in production can have a big impact, so limit who may change it and record every change and who made it
  • Inconsistent behavior: users who suddenly see a feature appear and disappear between visits will be confused, so make sure the same user stays consistently on one variant
  • Dependence on the flag service: if switch values are fetched from an external service, define a safe default behavior for when that service cannot be reached
  • Testing complexity: the more flags are active, the more combinations must be tested

Simple but effective management practices:

  • Give every flag a clear name, an owner, a purpose, a creation date, and a target removal date
  • Keep a list of active flags and review it periodically, for example monthly
  • Make flag removal part of a feature's definition of done
  • Define a safe default behavior if the switch value cannot be read
  • Limit access to changing production flags and keep an audit trail

Build it yourself or use a service

For most small and medium businesses, feature switches can start very simply: a settings table in the database or a configuration file read by the application, with a small admin page to change it. This is enough for emergency switches and simple gradual launches based on a user list or percentage.

A dedicated feature flag service becomes useful when you need complex targeting, measurable experiments, management of many environments, detailed access rights, or a full audit trail. Consider subscription cost, the risk of dependence on a third party, and the need to keep user data safe. Start simple, and step up when real needs appear.

Steps to start within a few weeks

1. Pick one high risk feature that will be released next, for example a change to the checkout flow or price calculation.

2. Build a simple switch mechanism that can be changed without redeploying the application.

3. Decide who is authorized to change it and how changes are recorded.

4. Set monitoring indicators and the threshold that triggers switching off.

5. Launch gradually: internal, pilot users, then increasing percentages, with monitoring pauses.

6. Once stable, switch on for everyone and schedule removal of the flag.

7. Evaluate the results, then extend the practice to other risky features.

Also include application maintenance after launch in the plan, because the habit of gradual release is most useful when followed by routine monitoring.

Frequently asked questions

Are feature flags only for big teams? No. The simple version, a switch in a settings table, is very useful even for small teams because it gives the ability to turn off a feature without redeploying.

Do flags slow the application down? The impact is generally very small if switch values are held in memory and refreshed periodically. Pay attention only if the switch is fetched from a network service on every request.

How long may a flag be left in place? Release flags should be removed within weeks after the feature is stable. Operational and plan flags may remain for a long time, provided they are documented and owned by someone.

Does gradual rollout mean users are used as guinea pigs? Not when done well. The aim is to protect users from problems hitting everyone at once, by starting with a small group, monitoring, and switching off if needed. For sensitive changes, choose groups that have been informed.

Conclusion

Feature flags and gradual rollouts turn a release from a big bet into a series of small, reversible steps. By separating code deployment from feature launch, monitoring indicators at each stage, and preparing an emergency switch, teams can release more often with lower risk. Balance it with discipline: give each flag an owner and a removal date so it does not become technical debt. Start with one risky feature and a simple mechanism, then grow as needed.

Want to release features with lower risk?

The AG·SORA team helps design gradual release flows, feature switches, monitoring, and testing for your web and mobile business applications. The first consultation is free and without obligation.

Free Consultation

Free checklist: choosing a software house

24 points to evaluate a vendor before you sign. Can be saved as a PDF.

Get the checklist

Ready to build a system that grows with your business?

Discuss your needs with the AG·SORA team, no cost, no commitment.