Hypothetical scenario. Northwind needs a new price-revision field. Dev prepares the application change and removes the old field in the same migration. Priya asks the previous application to read the new state as if the release had to be withdrawn.
Dev: “The new application passes its health check.”
Maya: “Can the earlier application still serve correctly if we need to return to it?”
Treat a release as a change between interacting contracts. Stage compatible readers and writers, limit initial exposure and choose stop evidence before widening the rollout. The canary calculation introduces its own selected cohort; it does not claim observed catalogue capacity.
Which contracts change when this release serves work?
A deployment makes a new application configuration serve work. The configuration includes executable artifacts, schema expectations, API versions, service permissions and the interpretation of stored state. Northwind can keep the same URL while changing a response in a way that breaks its consumer. Reachability and compatibility are therefore separate release conditions.
A canary exposes a bounded population to a candidate while a baseline remains available for comparison. Its purpose is to collect decision evidence before wider exposure. A rollout percentage describes the exposure limit; it does not establish that the selected requests represent the workload or that enough observations have arrived to make the next decision.
Rollback directs future handling back to an earlier compatible release. It cannot unsend a customer message or erase a payment already committed at a provider. Those effects need recorded identities and their own recovery. Treating a release switch as an undo button confuses control of future requests with reversal of external history.
Why a successful health check is insufficient
A health endpoint can remain green while the catalogue returns stale price evidence or a malformed reservation. Choose checks from the user journey. For Northwind, current price evidence, parseable structure and an authorized reservation are part of a useful result. A low HTTP error rate says little about those semantic requirements.
The obvious response is to run every test against every release and then deploy everything at once. That improves pre-release evidence, but a finite test set still misses workload differences and serving-environment failures. A bounded release adds another observation point. It is especially useful when the possible consequence justifies limiting exposure while real traffic supplies missing evidence.
Define the release unit before comparing it. If Dev changes the API handler, database query and schema together, that combined candidate can be evaluated, but a regression cannot automatically be attributed to the query. The manifest should identify each dependency so the team can reproduce the relevant configuration and choose a compatible recovery set.
Keep rollback compatible with persisted state
Hypothetical scenario. A new writer adds field price_evidence_v2. First expand readers so they tolerate both representations, then introduce compatible writes, migrate old state, observe adoption and only later remove the old form. Keep each phase independently recoverable.
| Release stage | Readers | Writers |
|---|---|---|
| Expand | Old and new forms | Old compatible form |
| Migrate | Both forms | Compatible new form |
| Contract | New form after proof | New form; rollback plan updated |
A canary checks behavior for admitted traffic, not merely process health. Compare equivalent workload cohorts and preserve failures, rejected work and pending outcomes in the ledger. Shadow reads can compare outputs, but shadow writes or provider calls require effect suppression or isolated authority.
Rollback after new data has been stored must still parse and honor that data. Reverting a binary cannot remove a message already consumed, a column already dropped or an external payment already made. Define forward repair when an old release cannot safely resume. Index or partition migrations also need explicit snapshot, catch-up, cutover and retained rollback evidence rather than treating the feature flag as the whole protocol.
Expand and contract a schema over separate releases
Suppose a new consumer expects a price revision field that old records lack. An expand step first makes readers accept both forms and adds the field without removing the old path. Writers can then populate it while a backfill updates older records. A later contract step removes the obsolete representation after every dependent reader and rollback configuration can tolerate that change.
This sequence preserves room for a rollback during the transition. Dropping a required column at the same moment a new binary begins using its replacement can make the previous binary unusable. Keeping an old executable artifact is not sufficient when its assumed data shape no longer exists. Record schema and data compatibility explicitly in the release manifest.
For a versioned API response, readers and writers must agree about field meaning as well as syntax. A new optional field can coexist with tolerant older consumers; removing a required field needs a declared migration. PostgreSQL’s schema operations also have locking and rewrite behavior to inspect before choosing the deployment window.
A backfill must lose to a newer live edit
Hypothetical scenario. The expanded product record retains its old price and adds a new representation with a source-revision field. A backfill reads Q7 at revision 12 with a selected price of 1,200 minor units. Before its write arrives, a live edit commits revision 13 with price 1,300. Blindly storing the delayed conversion of revision 12 would overwrite newer evidence even though both binaries accept the expanded schema.
| Step | Observed source | Required result |
|---|---|---|
| Backfill reads | Revision 12 / 1,200 | Retain expected revision 12 |
| Live writer commits | Revision 13 / 1,300 | Update source and new representation together |
| Old backfill tries to commit | Current revision is 13 | Conditional write matches zero rows; reread |
For this PostgreSQL exercise, require the source revision still to equal the revision read, and reject a target already representing newer evidence. The live writer maintains both representations in the same row transaction. PostgreSQL’s UPDATE reference defines condition-based updates and returned updated rows; the migration must choose and verify the actual transaction behavior. Merely adding a version column does not enforce the comparison.
Choose 1,000 records per batch and an assumed budget of two completed batches per second. Nominal work is 1,000 × 2 = 2,000 records per second; 1,000,000 records would take 1,000,000 ÷ 2,000 = 500 seconds before conflicts, pauses or retries. Checkpoint only completed work, revisit conflicts and verify source/target revisions before cutover. A completed range scan alone cannot establish that every converted value remains current.
Derive the observation window from admitted work
Hypothetical worked example: Northwind receives 100 eligible requests per second and routes 5% to a canary. Candidate traffic is 100 × 0.05 = 5 requests per second. Over a chosen 10-minute observation window, 10 × 60 = 600 seconds, so the expected candidate population is 5 × 600 = 3,000 requests when the rate and routing share remain constant.
Assume a deliberately chosen stop rule: halt expansion if more than 1% of that completed cohort has a parser failure. One percent of 3,000 is 30. A count above 30 triggers the rule; exactly 30 does not under this wording. This is an illustrative operational threshold, not a statistical claim or a recommended universal error budget.
Compare the baseline on the same task categories and time interval. A sale changes the input mix, so yesterday’s average is a weak control. Track the denominator for each slice, including abstentions and rejected work. Waiting for 3,000 completions also differs from waiting ten minutes if some requests are still queued or unresolved.
The canary needs a minimum-information condition as well as a maximum-exposure condition. A rare permission failure can matter before enough ordinary requests accumulate to estimate an average. Northwind should stop immediately on a confirmed forbidden disclosure rather than let a numerical aggregate excuse it until the observation window closes.
Keep shadow traffic from duplicating effects
A shadow receives eligible input and produces a candidate result without becoming the source of business actions. It helps compare representations, schemas and latency under a realistic input population. Disable consequential writes in the shadow path. A second refund is not an acceptable price for a more realistic comparison.
Preserve the evidence revision and task identity for each paired comparison. If the baseline saw yesterday’s price revision while the candidate saw today’s, the result confounds source freshness with handler behavior. A comparison record should identify the query, source revision, permissions and configuration without copying unnecessary private content into broadly accessible logs.
A human reviewer can inspect disagreements, but the review queue needs ownership and a spending limit. If every disagreement sits indefinitely, the release decision has merely moved into an unbounded backlog. Decide which differences block expansion, which require investigation and which are acceptable wording changes before the first canary cohort begins.
In the wild: a bounded command can still have broad dependencies
Amazon’s public account of the February 2017 S3 disruption describes a command intended to remove a small number of servers that removed a larger set than intended. The report explains recovery dependencies and subsequent safeguards. This is a real published incident; it is not a claim about Northwind’s operations or a forecast of a similar outage.
The transferable issue is the relationship between operator intent and enforced scope. A release control should bound the actual population affected, not merely display a reassuring percentage beside a command. Validate scope, establish a stop path and understand which shared dependency can make an apparently small change affect unrelated traffic.
Regional failover needs its own acceptance test
A second region changes routing, data freshness, available capacity and sometimes dependency behavior. An endpoint that accepts a probe is not evidence that it can serve the entire workload. Derive the admitted rate and inspect replication lag before moving writes. Region count alone does not establish an availability claim.
For read-only catalogue responses, a stale replica can display a superseded price. For payments, two regions must not independently create effects for the same approved action. Keep the authoritative operation identity and fencing arrangement clear. A regional failover test should include recovery and reconciliation, not only the first successful response from the alternate location.
A rollback during regional recovery can be constrained by both data compatibility and capacity. If the previous region is still unavailable, reverting the binary there is not an immediate service-restoration option. Record which recovery actions remain executable under each failure condition rather than assuming every arrow in the diagram is always available.
The release reverts but the data does not
Hypothetical failure scenario. The new application removes an old quantity field and writes only its replacement. A canary check stops expansion, but the saved prior image cannot read current rows. Reverting traffic therefore fails to restore service. The rollback artifact exists; the compatible stored-state contract does not.
Keep the old representation and a coherent write policy through the migration window, or establish a separately evaluated data recovery path. A dual-write plan also needs atomicity or reconciliation for disagreements. Removing old state is a later decision supported by evidence about every remaining reader and recovery configuration.
Misconceptions that make a release look safer than it is
A small traffic percentage does not bound impact when the candidate writes shared state read by everyone. A saved old image does not prove a working rollback after an incompatible migration. An apparently clean error-rate graph does not prove that private evidence remained private. Each promise needs a measurement or an enforcement point that matches the consequence.
Another misconception is that a canary must eventually expand. A candidate can remain blocked or be discarded when the evidence does not support it. Returning to a known compatible configuration is a valid outcome. Preserve the failed candidate’s observations so the next release addresses the actual regression rather than repeating a slightly different guess.
Choose the release mechanism by reversibility
Use a direct small change when its scope is narrow, its consequences are understood and recovery is straightforward. Use shadowing and canaries when behavior depends on real input distribution or consequences justify bounded exposure. Use staged data migration when old and new components must coexist. The appropriate process follows the failure and recovery contract.
Northwind assigns Dev the manifest and compatibility checks, Priya the user-outcome rubric and Sam the rollout and stop controls. An expansion requires all three views to agree. This keeps a fast technically successful deployment from overriding a product-level failure that another owner can already demonstrate.
After a rollback, review the failed cohort against the original manifest. Record which signal stopped expansion and whether the recovery preserved the expected customer state. That short decision record makes the next attempt a targeted repair rather than another unexamined deployment.
Limits of a green canary
A finite cohort cannot certify future traffic, and a quiet interval can miss a rare important task. A regional incident can also remove the baseline needed for a clean comparison. State those limits in the release decision, retain a usable compatible recovery configuration and continue monitoring the same acceptance conditions after expansion.
Challenge the proposed mechanism
A canary is healthy, but the old release cannot read its persisted messages. Can rollback still be the stop action?
Reveal the design reasoning
Not without a compatible reader or repair path. Stop expansion and select the documented forward recovery if necessary. The review must test persisted-state and remote-effect compatibility before calling a release reversible.
Decision and reconsideration: Approve changes with a mixed-version and state-recovery argument. Reconsider contraction only after old readers and retained work are accounted for.
Defend the release decision
A 5% canary receives 100 eligible requests/s for ten minutes. How many candidate requests are expected?
Check exposure and compatibility
Five per second over 600 seconds gives 3,000, assuming the arrival rate and allocation stay constant. Count completed and unresolved work separately.
The old image exists, but its required column was dropped. Is rollback ready?
Check exposure and compatibility
No. The artifact and stored-state contract are incompatible. Preserve an expand/contract transition or provide a separately evaluated recovery path.
The shadow proposes a refund. Should it execute to test realism?
Check exposure and compatibility
No. Keep the comparison non-effecting; inspect the proposal against the actual authorization contract without creating another business action.
A controlled rollout limits new exposure, but failure can still remove a region or require older data. Page 38 examines recovery objectives and tests what restoration would actually make usable.
Northwind decision log
- Bind the release to a versioned configuration and acceptance rubric.
- Expand only while the canary’s evidence supports the contract.
- Keep schema-compatible recovery and action reconciliation separate.
Go deeper: compatible interfaces and retained state
- Book chapter: API Design Patterns, chapter 24: Versioning and compatibility — JJ Geewax. Separate reachability from a compatible contract.
- Book chapter: API Design Patterns, chapter 28: Resource revisions — JJ Geewax. Name the version of retained state.
- Video lecture: F2023 #20: Database Recovery — CMU Database Group. Examine recovery of durable state independently of application deployment.
- Primary document: Parallel Change — Danilo Sato. Inspect the expand, migrate and contract sequence.
- Primary document: Amazon S3 disruption summary — AWS. Read the documented operational-scope and recovery lessons.