Jump to text
On this page
Copy and source
Published source confirmed at last check

Source changed 2026-11-26 21:07:53 UTC · snapshot created 2026-11-26 21:08:36 UTC · last check 2026-11-29 23:30:20 UTC

SYSE.34:4.6 - Derive the transition from compatibility in both time directions

Treat each intermediate state as a combination of running readers and writers, stored representations and in-flight work. Ask two different questions: can the next version use the state it will receive, and can the intended recovery version use the state the next version may create? Successful upgrade alone does not answer return. Include asynchronous messages and queued jobs: they can carry an older contract after its producer has stopped running.

Construct the transition backward from the desired new use. Identify the first action that requires new information, a new representation or a new interpretation. Before that action, establish every consumer capability needed for coexistence. One useful arrangement is to deploy readers that understand both forms while writers still emit the old form, then change writers after the dual-reading capability is present where needed. Another retains one old representation as authoritative and adapts new use to it, as in section 5. Both have costs: dual readers must remain correct for both meanings, while an adapter can limit which new values are expressible.

Compare those arrangements with a coordinated interruption. If all consumers can be stopped within an acceptable interval, a verified backup and a bounded offline transformation may need less mechanism than online coexistence. For that interruption, prevent late writes, define the population to transform, and decide how to recover from partial completion. A large table, strict availability need or independently upgraded clients can make that arrangement infeasible. Choose the strategy whose interruption, recovery and compatibility conditions the service can support.

Common mechanisms for a continuously updated dataset include transactional projection, change-stream replication and a bounded write fence. A transaction can update the authoritative value and its derived representation together. A qualified change stream can carry updates after a known snapshot position, with ordering, replay and gap detection that the consumer understands. A bounded write fence can create a stable interval for transformation and switch. Merely running a bulk copy while writers remain active supplies none of these guarantees. A change-stream design additionally needs a rule for duplicates, reordering, deletion and catching up before the new reader depends on it. Obtain the storage-specific implementation for the chosen mechanism.

Do not treat coexistence completion as permission to remove old support. Find what can still return old data: a scheduled job, retained message, offline client, dormant disaster-recovery image or a restore from an earlier backup. A contraction may require keeping a conversion on the restore path even after no live client uses it. Select a compatibility horizon from those supported uses and retention commitments. This horizon can differ from the time needed to observe a canary or to finish the ordinary application rollout.

For a claimed return, follow the states reachable under the admitted sequence of reads, writes and interruptions. One state can qualify the others when its recovery conditions demonstrably cover theirs. More queued records can bound recovery time while a single new value the old representation cannot express defeats exact return. Use a proof for the supported class or qualify the consequential classes separately, including any time or loss limit. In a coexistence strategy, include old and new writes; include partial migration and lost acknowledgement where they can affect the return. Follow which representation each reader sees and which effect a repeated operation could duplicate. If return would discard legitimate later events, decide whether those events can be replayed or reconciled and who may accept the remaining loss. A backup can supply older data without supplying this reconciliation. Keep a useful forward-repair option when exact reversal is unavailable.

For an unlike case, a job-message format gains a new optional field. First release workers able to read both formats while producers continue sending the old one. Then change a bounded producer population and observe completion of whole jobs. Retiring old workers is insufficient evidence to remove old-format reading: queued or archived jobs may still contain it. Conversely, rolling producers back does not remove already emitted new-format messages. If old workers cannot read those messages, recovery must retain compatible workers, translate messages with qualified meaning, or drain the queue under an agreed restriction. This is the same compatibility reasoning with a different persistence mechanism; the PostgreSQL trigger in section 5 is not its implementation.