Database Zero-Downtime Migration & Rollback Orchestration
Plan high-volume, live table restructuring and large column migrations without application outages.
Orchestrate multi-phase Expand/Contract migrations for multi-million row tables: additive schema changes, throttled dual-writing backfills, read cutovers, and safe contraction.
Execution Workflow Procedure
Ordered steps the coding agent executes when performing this skill.
Phase 1: Expand (Additive Schema Change)
Execute DDL adding new columns with lock_timeout guards, ensuring running application pods remain unaffected.
Phase 2: Dual-Writing & Throttled Backfill
Update application code to write to both columns and run a batched background script to backfill historical rows.
Phase 3: Switch Reads & Verify
Switch application reads to the new schema and monitor latency and error rates.
Phase 4: Contract (Cleanup)
Safely drop the deprecated column in a follow-up release after verification.
Agent Safety Guardrails & Anti-Hallucination Rules
- DO NOT execute un-throttled UPDATE statements across millions of rows that trigger replication lag.
- DO NOT drop old columns before full verification across at least one production release cycle.
Expected Output Format
Phased rollout steps with backfill scripts and rollback plans.
Domain Verification Checks
Example Agent Invocations
Install / Configure This Skill
# Place in .cursorrules or create .cursor/rules/zero-downtime-database-migration-strategy.mdc # Trigger: Whenever you perform database zero-downtime migration & rollback orchestration --- name: zero-downtime-database-migration-strategy description: Orchestrate multi-phase zero-downtime database migrations with Expand/Contract patterns and throttled backfills. version: 1.0.0 compatibility: [Cursor, Claude Code, Cline, Roo Code, Antigravity] --- # Database Zero-Downtime Migration & Rollback Orchestration ## Objective Restructure high-traffic database tables and execute large backfills without downtime or replication lag. ## Workflow 1. **Expand Phase**: Add additive columns with strict `lock_timeout` settings. 2. **Dual-Writing & Backfill**: Write to both columns while backfilling historical data in throttled batches. 3. **Read Switch**: Shift application queries to the new structure. 4. **Contract Phase**: Clean up old columns in a subsequent release cycle.
Need a quick one-time prompt for chat?
Try the Database Zero-Downtime Migration & Rollback Strategy — a lightweight version designed for 1-click copying directly into Claude, ChatGPT, or Cursor chat.
SprintKit Workflow Integrations
Complementary tools and checklists to pair with this agent workflow.
Related Agent Skills
Explore related procedural workflows in this discipline.
Database Migration Rollback & Data Integrity Validation
Validate database schema migrations for zero data loss, backward compatibility, and forward/backward rollbacks.
Relational Database Schema Normalization & Indexing Strategy
Design production PostgreSQL schemas with composite indexes, foreign key strategies, and partitioning.
Database Deadlock & Concurrency Race Condition Diagnosis
Diagnose Postgres/MySQL transaction deadlocks, lock contention, and concurrent update race conditions.