Plan a database migration strategy
Plan a zero-downtime database migration with an expand-contract pattern, dual-write transition, and explicit rollback steps at every stage.
Preview
Copy prompt
Plan a zero-downtime database schema migration from [Schema A] to [Schema B] for a live system handling [N] requests per second. Apply the expand-contract pattern in three phases: first expand the schema by adding new columns or tables while keeping the old ones, then migrate the application to write to both old and new structures simultaneously, then cut over reads to the new structure once data is consistent, and finally contract the schema by removing the now-redundant old columns. For each phase document the exact schema changes, the required application code changes, and the explicit rollback steps.
More
Architecture
Prompts
