PromptScan: pass
Zero-Downtime Migration Plan
Plans a zero-downtime migration (schema, datastore, service, or provider) as reversible phases with verification gates, dual-write or dual-read strategy, and explicit rollback at every step.
Add a trust badge to your README
[](https://waxmark.app/items/migration-plan-zero-downtime/scan)
Plan a zero-downtime migration from the current state to the target state described below. "Zero downtime" means no user-visible errors or data loss at any point, and every phase can be reversed without data loss until the final cutover is declared complete. A plan with a step that cannot be rolled back is not finished.
<migration_goal>
{{MIGRATION_GOAL}}
</migration_goal>
<current_state>
{{CURRENT_STATE}}
</current_state>
<target_state>
{{TARGET_STATE}}
</target_state>
<traffic_profile>
{{TRAFFIC_PROFILE}}
</traffic_profile>
<constraints>
{{CONSTRAINTS}}
</constraints>
<current_state> and <target_state> describe schema, datastores, services, or providers, with the code paths that read and write. <traffic_profile> covers request rates, peak windows, write/read ratio, and data volume. <constraints> covers deadlines, freeze windows, compliance, team size, and tooling available (feature flags, blue/green, CDC tools).
Method:
1. Identify every component that must change and classify each as `additive` (can coexist with the old), `transformative` (changes meaning of existing data or behavior), or `destructive` (removes something). Destructive steps go last, after a soak period, and are the only steps allowed to be irreversible.
2. Sequence the migration using the expand/migrate/contract pattern: add the new structure alongside the old, make writers write to both (or stream changes via CDC), backfill history, verify equivalence, switch readers gradually behind a flag, soak, then remove the old. Adapt the pattern to this migration and state where it does not apply.
3. For each phase, specify: the change, the exact verification that gates the next phase (a query comparing row counts and checksums, a diff of responses, an error-rate threshold over a time window), the rollback action, and how long the phase should run before advancing. A gate without a number is not a gate.
4. Define the dual-write or dual-read period precisely: how divergence is detected, how conflicts are resolved, what the lag tolerance is, and what happens to writes that fail on one side.
5. Call out the risky moments: the backfill's load on the source, the instant readers flip, schema changes that lock tables (name the ones that do in this datastore), caches that hold old shapes, and clients that cannot be upgraded at once. For each, state the mitigation and which phase it belongs to.
6. Schedule against <traffic_profile>: which phases run at low traffic, which can run any time, and the total elapsed time including soak. Check the schedule against <constraints> and flag conflicts.
7. Define "done": the observable conditions under which the old path is deleted and the migration is closed, and the point after which rollback is no longer possible.
Prefer boring, reversible steps over clever ones. If a step saves time but removes a rollback, note it as an option, not the plan.
## Output format
**Summary** - 3-4 sentences: what moves, the pattern used, total elapsed time, and the point of no return.
**Component inventory** - table: component, change type (`additive` / `transformative` / `destructive`), phase.
**Phases** - numbered; each as a block:
- Change: what is done, by whom, with what tool
- Verification gate: exact check, threshold, duration
- Rollback: exact action and what state it restores
- Duration: minimum run time before advancing
- Traffic window: any-time / low-traffic / freeze-window
**Dual-write / dual-read design** - divergence detection, conflict rule, lag tolerance, failure handling.
**Risk register** - table: risk, phase, mitigation, early-warning signal.
**Schedule** - table: phase, earliest start, duration, dependencies, constraint conflicts.
**Definition of done and point of no return** - 2-4 sentences.
**Open questions** - what the inputs did not settle and who should answer.