Migration & Compatibility

Every change to a running system has an initial state, a transition state, a final state and a way back. Backward compatibility, versioning and data migration.

Designing the Migration
▶ lab

Every change to a running system has an initial state, a transition state, a final state and a way back. The transition state is the one people skip, and it is live in production longest.

Q · I have designed what the system should look like afterwards. What else does a change to a live system need before it is a design?
Backward Compatibility as a Constraint
▶ lab

Old clients, stored data, in-flight events, published APIs, plugins and databases all constrain what today's change may do. Compatibility is not a property of an API; it is a constraint on every edit.

Q · Who is still running the old version of this, and what does that forbid me from doing today?
Versioned Interfaces

An explicit version lets old and new consumers disagree about the contract. It also creates a maintenance obligation that lasts as long as the oldest version you have not managed to kill.

Q · Should this interface carry an explicit version, or should it just never break?
Data Migration
▶ lab

Schema, data and application code are three things that must change in a safe order. Getting the order wrong is the difference between a routine deploy and a restore from backup.

Q · The schema has to change, the existing rows have to change, and the code has to change. What order does that happen in, and what is live in between?
Expand and Contract
▶ lab

Add the new shape, write both, migrate readers, stop writing the old, remove it. The canonical safe sequence, and the reason it works is that every step is individually revertible.

Q · What is the general sequence for replacing one representation with another while everything keeps running?
Feature Flags and What They Cost
▶ lab

A flag decouples deploying code from releasing behaviour, which is genuinely valuable. It also multiplies the state space of the system and creates a cleanup obligation nobody is measured on.

Q · What does adding a flag do to the number of behaviours my system can exhibit, and who removes it?