liveBook · Manning

Feature flag

As explained in Grokking Software Architecture

A feature flag is a runtime switch that changes application behavior without requiring a new deployment.

A feature flag is a runtime switch that changes which code path an application takes without changing its compiled code or redeploying. It separates deployment—the engineering act of putting code into production—from release—the product decision to expose a feature to users. section 13.3.4

That separation turns a risky all-or-nothing launch into a switch you can control. Deploy new code with its flag off, then enable it for selected testers or accounts. When the feature is ready, change the flag rather than restarting the delivery pipeline. If something goes wrong, disable the feature without rolling back the deployment. section 13.3.4

Two discount paths, one runtime switch

An order can use the new enterprise discount logic only when its flag is enabled; otherwise, it continues using the legacy logic. This lets new code sit in production while remaining unavailable to most users. section 13.3.4

Figure 13.4 Separation of Concerns: Deployment is the technical operation of placing files on a server; Release is the business decision to expose those files to your users.

Use the deployment-versus-release distinction to see what the flag separates: placing files on a server is not the same decision as exposing a feature to users. section 13.3.4

Flags can also act as safety latches during database changes. If new code writes data in a format older application versions cannot handle, an independent flag can turn off that new writing path during a rollback. Keep the switch for that behavior separate from the main release flag. section 13.4.3

How Grokking Software Architecture covers it

How deep it goes
Defines runtime switching and explains dark launches, targeted activation, and a data-write safety latch.
Examples
Uses an enterprise discount code path, QA-only activation, and an emergency switch for legacy data formats.
What it assumes
Teaches the deployment-versus-release distinction from its definitions, without requiring prior flag knowledge.
What you can do after
Operate a release switch to expose new logic selectively or disable a risky data-writing path.
How it connects
Connects feature flags to deployment, release, dark launches, and the Expand/Contract Pattern.

Also explained in

Compare how 10 books explain feature flag →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Grokking Software Architecture. The section links point to the parts of the book it draws on.