AlgoViz

Releasing schema changes across mixed versions

medium 6 min

During a rolling deployment old and new binaries can read and write the same data.

Video lesson · Chapter 1 of 4

A new column meets an old reader

0:00 / 2:18

Theory

Read or listen first. About 1 min.

What it is

During a rolling deployment old and new binaries can read and write the same data. A schema migration is therefore a protocol change across versions. Expand the schema first, introduce compatible readers and writers, backfill in bounded batches, validate the result and remove the old representation only after every dependent path has moved.

Why it exists

A migration immediately requires a field that old workers omit. New requests pass smoke tests but in-flight jobs from the previous release start failing. Inventory readers, writers, rollback candidates and asynchronous consumers. Inspect lock acquisition as well as data compatibility because even a metadata change may wait behind a long transaction.

If mixed-version writes succeed but latency rises, inspect migration lock queues and backfill I/O before modifying format compatibility.

A new column meets an old reader

Old service → Shared database (old row format). New service → Shared database (new row format)
Old service → Shared database (old row format). New service → Shared database (new row format)

How it works

Step through the idea, or press Play.

Step 1 of 3

Baseline. Both versions accept the old representation.

Understand it

Worked incident

A new column meets an old reader

ObservationIncompatible writes per 1000 (writes)Interpretation
Baseline0Both versions accept the old representation.
Incident65A new constraint rejects writes from still-running old workers.
After intervention0Restore a compatible transition and validate before enforcing the constraint. Exercise a mixed-version window.
Illustrative measurements from the same workload at three checkpoints.

Choose the next investigation

If mixed-version writes succeed but latency rises, inspect migration lock queues and backfill I/O before modifying format compatibility.

Summary

The whole topic in one minute.

The rollout includes mixed generations. Compatibility must hold through deployment and the promised rollback window.

If mixed-version writes succeed but latency rises, inspect migration lock queues and backfill I/O before modifying format compatibility.

Sources