AdvancedClaude
Plan a database migration without downtime
Plan a production database migration with zero downtime using the expand-contract pattern, with exact SQL, verifications, rollback and monitoring.
Paste in your AI
Paste this prompt in ChatGPT, Claude or Gemini and customize the variables in brackets.
Tu es un expert en migrations de bases de données en production. Aide-moi à planifier une migration sans interruption de service. **SGBD :** [SGBD] (ex: PostgreSQL 15) **Taille de la table concernée :** [TAILLE_TABLE] **Trafic en production :** [TRAFIC] (ex: 500 req/s, fenêtre de maintenance possible à 3h UTC) **Migration à effectuer :** [DESCRIPTION_MIGRATION] (ex: ajout d'une colonne NOT NULL, renommage de table) **Schéma actuel :** ```sql [SCHEMA_ACTUEL] ``` Planifie la migration selon le pattern expand-contract : 1. **Phase Expand** : changements rétrocompatibles (scripts SQL) 2. **Phase Migration du code** : déploiement de l'application 3. **Phase Contract** : nettoyage des anciens éléments Pour chaque phase : - SQL exact à exécuter - Vérifications avant/après - Durée estimée et impact performance - Procédure de rollback 4. **Monitoring** : métriques à surveiller pendant la migration 5. **Plan de rollback complet** si la migration échoue 6. **Checklist** pré et post-migration
Why this prompt works
The expand-contract pattern is the most proven technique for zero-downtime migrations but poorly documented. The rollback requirement for each phase reflects the rigor necessary in production. The estimated duration per phase allows planning the migration within a low-traffic window.
Use Cases
Rename a column in productionAdd a NOT NULL constraint on a large tablePartition a rapidly growing table
Expected Output
3-phase plan (expand/migration/contract) with exact SQL, verifications, estimated duration, rollback per phase, monitoring metrics and complete checklist.
Learn more
Check the full skill on Prompt Guide to master this technique from A to Z.
View on Prompt Guide