Skip to content
$EngineeringAtlas

Feature Flags Without the Tech Debt

Rolling out safely with flags — and remembering to delete them.

Amit Kumar Singh2 min read

The Problem

Feature flags make releases safer, but unmanaged flags become hidden branches in production. After a few months, nobody knows which paths are active or safe to delete.

Why It Matters

Flags separate deployment from release. You can deploy code safely, expose it to a small audience, watch metrics, and roll back behavior without shipping another build. Companies with mature delivery practices use this pattern because it reduces the blast radius of change.

The cost is complexity. Every active flag doubles some part of the behavior matrix, so the team needs ownership and cleanup discipline.

Project Example

A team ships a new checkout flow behind checkout_v2_enabled. The flag starts at 1% for internal users, then 5%, 25%, and 100%. If conversion drops or errors rise, the team disables the flag without rolling back the whole deployment.

Implementation Example

const useCheckoutV2 = await flags.enabled("checkout_v2_enabled", {
  userId: user.id,
  tenantId: user.tenantId,
  country: user.country,
});

return useCheckoutV2 ? checkoutV2(input) : checkoutV1(input);

Log the evaluated flag value with request metadata. When errors rise, you need to know whether failures happened on the old path, the new path, or both.

Implementation Checklist

  • Give every flag an owner and expiry date.
  • Separate release flags from permission flags and experiment flags.
  • Log flag values in request context for debugging.
  • Add dashboards for flag rollout, error rate, and business metrics.
  • Delete the old code path after the rollout is complete.
  • Define the rollback condition before rollout starts.
  • Keep database changes compatible with both flag states.
  • Include flag state in support and incident tooling.

Production Notes

LaunchDarkly, Unleash, ConfigCat, and similar systems exist because flags become operational infrastructure at scale. For a small app, a simple config-backed flag system can work, but it still needs audit logs and ownership.

Common Mistakes

  • Using one permanent flag for multiple unrelated changes.
  • Evaluating flags only on the client for sensitive features.
  • Forgetting database compatibility when both paths run together.
  • Leaving stale flags in code for years.
  • Turning off a flag but leaving old data migrations active.

Summary

Feature flags are a deployment tool, not a substitute for design. They work best with ownership, metrics, expiry, and disciplined cleanup.

Amit Kumar Singh

// written by

Amit Kumar Singh

Software engineer writing about backend systems, cloud, and the realities of running code in production.

$ subscribe --weekly

The weekly engineering digest

Production-grade engineering writing in your inbox. No spam, unsubscribe anytime.

## related