Feature Flag 101

Why should we use feature flag?

Oct 24, 2025   

preview

What is feature flag?

Let assume your team is working on a stable production website. The team want to make some new feature and roll it out to users. However, before deploy it out to all users. We want to test if the user actually like the feature or not, so we have to roll it out to some internal user only, collect some data then decide.

Feature flag is an easy way to achieve this task.

How does it work

Feature flag work something like this:


SHOW_NEW_FEATURE = evaluate_flag(user, location, ...) # make a external api call to decide value

if SHOW_NEW_FEATURE:
    newLogic()
else:
    oldLogic()

evaluate_flag() will call external service like LaunchDarkly to get the value. This allow PM roll out feature to user without deployment or engineer support. The flag often submited with additional context like user_id, location, domain data. This data can be analayze to see how the new feature was used.

Other usecases

Reference



Next: MD5 notes