Skip to main content

> Term

Migration Plan

A step-by-step technical strategy to safely apply schema or state changes without causing downtime or data loss.

Detailed Explanation

A migration plan outlines the exact sequence of SQL scripts, code deployments, and rollback procedures needed to transition a database schema from its current state to a new state.

A good plan accounts for locking mechanisms, long-running transactions, backwards compatibility, and the multi-step nature of safe deployments (e.g., expand/contract patterns).

Why It Matters

Turns database changes from a terrifying, high-risk roulette into a predictable, safe, and repeatable engineering process.

Common Failure Mode

Applying a schema change that locks a massive core table for 20 minutes, effectively causing a production outage because the migration plan didn't account for lock contention.

Practical Example

Using the Expand/Contract pattern to rename a column safely in a migration plan.

Production Manifestation

Versioned SQL files, automated migration tools like Flyway, Liquibase, or Prisma Migrate, and written rollback runbooks.

Frequently Asked Questions

What is Migration Plan in short?

A step-by-step technical strategy to safely apply schema or state changes without causing downtime or data loss.

What is the most common failure mode?

Applying a schema change that locks a massive core table for 20 minutes, effectively causing a production outage because the migration plan didn't account for lock contention.

AI Summary

A step-by-step technical strategy to safely apply schema or state changes without causing downtime or data loss. Turns database changes from a terrifying, high-risk roulette into a predictable, safe, and repeatable engineering process.