A gradual rollout changes who can exercise new code without necessarily changing the deployed artifact. A kill switch stops a named behavior quickly when measured harm appears. Neither is a substitute for rollback design: new writes may have changed stored data, queued jobs, cache entries, or client state that old code must still handle. A safe release defines exposure stages, guardrail metrics, stop thresholds, and a state-compatibility window before the first user enters. Disabling a flag can prevent new work but cannot undo completed payment, uploaded bytes, or sent messages.
Gradual Rollout, Kill Switch, and State Compatibility
Working case
The new assignment panel is enabled for 5 percent of reviewer accounts, then 23 percent after an observation window. Assignment writes still use the same revisioned API, so turning the panel off routes future edits through the old interface. During the second stage, save failures rise for the new variant. The on-call owner disables the panel and verifies that cases edited by the new form still open in the old form. A background assignment email already queued remains valid; the switch does not erase it. The team keeps the new code deployed while investigating and records the ruleset version that exposed each request.
Implementation boundary
function shouldStopRollout(failures, attempts, limit) {
return attempts > 0 && failures / attempts > limit;
}
console.log(shouldStopRollout(7, 47, 0.1));
// Output: trueStage by stable units and preserve membership as the percentage changes; a naive threshold change can reshuffle users if the hash or salt changes. Start with staff and a small cohort, then advance only when request success, latency, accessibility, and error signals meet named bounds. Keep the old and new data representations compatible for the rollout window, or supply a reversible migration plan. Test the off path after new writes have occurred, not only before launch. Separate a release flag from a long-lived operational circuit breaker. Ensure configuration updates reach the server within a documented time and that stale clients cannot force a disabled mutation. Record who changed the flag and why.
Cost and boundaries
Evaluating a cohort is cheap, but dual-path tests, state compatibility, and monitoring add delivery cost. A remote flag change can be faster than rebuilding, yet propagation has a measurable delay through caches and active browser tabs. Keeping both forms and schemas alive longer raises maintenance cost, so schedule removal after stability. A sudden 100 percent rollout can create nonlinear load if the new panel fetches extra data. Compare error and latency by variant and cohort size, and measure off-switch completion time. Guardrail metrics must reflect user outcomes, not only server uptime.
Failure trace
The team disables the panel after errors, but new writes stored a field the old form rejects. Reviewers cannot reopen recently edited cases. Test old-path reads against new-path data before rollout. Another kill switch only changes the browser bundle; already-open tabs continue sending new mutation shapes. Enforce the disablement at the server boundary. Test progression from staff to 5 and 23 percent, a stale configuration cache, an active tab during shutdown, queued work, rollout reversal, and a schema migration still in progress.
Verification
- A disabled release leaves prior writes readable.
- The server stops new-variant writes after the documented propagation bound.
- Cohort membership and stop decisions have audit evidence.
Practice drill
Assign stable cohorts to 47 reviewer IDs and record membership before and after raising the threshold. Create cases through both form variants, disable the new path, and reopen every case through the old one. Inject a save failure that breaches the stop rule, time how long evaluation changes take to reach workers and browsers, and inspect the audit record. Finally remove the flag in a branch and run both old and new data fixtures through the remaining code.
Decision note
Stage exposure against measured guardrails and prove the off path handles data created while the flag was on.
Common Mistakes
- Assuming an off switch reverses completed side effects.
- Testing the old path only before new data exists.
- Raising exposure without a capacity or error guardrail.
Connected lessons
Feature Release and Experiment Controls; Feature Flag Evaluation Scope and Safe Default; Experiment Assignment, Exposure, and Metric Integrity; Flag Telemetry, Audit, and Retirement; Expand-and-Contract Schema Migrations; Incident Containment and Evidence Timeline; API Evolution and Compatibility Windows.
Apply and check
Build Project: assignment panel release experiment and review Web Development: release and GraphQL decisions quiz.
