Plan a Zero-Downtime Migration Between Two Database Schemas

    Updated

    How to use it

    Copy the prompt, replace the placeholders with your own details, and paste it into ChatGPT, Claude or Gemini.

    Save and favourite prompts with a free account.

    Regression testing checklist template (with AI prompts)
    Read the story behind this prompt

    Regression testing checklist template (with AI prompts)

    Read the article
    Tap any variable to replace it with your own value:

    AI prompt

    Plan a zero-downtime migration from an old database schema to a new one. Old schema: [describe or paste the relevant tables/columns]. New schema: [describe the target structure and why it's changing, e.g. 'splitting a single users table into users and user_profiles']. Scale: [approximate row counts and whether this table is read-heavy, write-heavy, or both]. Produce a step-by-step migration plan using the expand-contract pattern: (1) the 'expand' phase - what gets added alongside the old structure without breaking anything currently reading it; (2) the dual-write or backfill step that populates the new structure from existing data, including how to handle rows that don't cleanly map; (3) the cutover point - what changes in the application code to start reading from the new structure, and how to verify parity between old and new before fully switching; (4) the 'contract' phase - what old columns/tables get safely dropped, and how long to wait before doing that. Flag the single riskiest step in this specific migration and what could go wrong there.

    Want to support this prompt?

    Share this prompt