A feature flag separates deployment from release. Evaluate flags through one typed service and define defaults, owner, expiry date, and removal plan; otherwise temporary branches become permanent complexity. Example: if (await features.IsEnabledAsync("NewCheckout", userContext, ct)) return await newCheckout.ExecuteAsync(command, ct); return await oldCheckout.ExecuteAsync(command, ct); Use stable targeting keys and keep evaluation consistent through a request. Do not use flags as authorization or expose secret configuration. Test both paths, instrument outcomes by variant, and use kill switches for risky integrations. Database/message changes must remain compatible while both paths can run. Remove the old path and flag after a successful rollout.
Backbencher Developer · · 0 likes