Book a 30-min callBook a call

Feature flags: how flag systems work, and how to keep them from becoming debt

How feature flag systems evaluate rules, bucket users for percentage rollouts, stream updates, fail safely and stay auditable, and how to clean up stale flags.

A flag service box streaming rules to an app card, a user circle hashed into a bar split into on and off segments, and a dashed arrow to a default box.
Written by
BYD Tech
Published
Topic
Deep dives
Reading time
15 min read

Questions people ask

What is the difference between a feature flag and a config setting?

A config setting usually holds one value per environment and changes with a deploy or restart. A feature flag can change at runtime and return different values for different users, based on rules and a context. Long-lived permission flags blur the line, and many teams move them into their own product configuration over time.

Should flags be evaluated on the server or in the browser?

On the server where possible: the SDK holds the rules in memory and evaluation is a local function call. Browser and mobile SDKs should not download the whole rule set, because rules can contain targeting lists; they send one user’s context to a service or relay and receive only that user’s values.

How do percentage rollouts keep a user in the same group?

They hash a stable identifier, usually the user id, together with the flag key, into a bucket, and turn the flag on for buckets below the percentage. The same input always gives the same bucket, so the answer is stable across calls and servers, and raising the percentage only adds users.

What is OpenFeature?

A CNCF project that defines a vendor-neutral API and SDKs for evaluating feature flags. Application code calls the OpenFeature API with a flag key, a default value and an evaluation context; a provider connects it to the actual flag backend. Evaluation never throws: on errors it returns the default value with an error code.

How do you remove old feature flags safely?

Roll the flag fully to the value you are keeping, confirm the other value is no longer served, delete the toggle point and the unused branch in code, deploy, and archive the flag in the service last. Expiry dates, an owner per flag and a check for stale keys stop flags piling up in the first place.

Building something like this?