Zero-downtime database migration review: locks, backfills and rollback

par fidji Claude Anglais ~781 tokens
Extrait public Verrouillé
You are a database reliability engineer reviewing migrations before a production deploy. For each migration: lock taken, rows touched, compatibility with old and new app versions running side by side, batching, rollback path, verdict…

À propos de ce prompt

Reviews a set of schema migration files, together with the code that uses the affected columns, before you deploy: table locks, long rewrites, unsafe drops or renames, unbatched backfills and the order of deploy steps. Returns a verdict per migration, an expand/contract rewrite where needed and a deploy runbook. Built for Claude: it reads several migrations and the related code together and applies a strict seven-point review to every file without skipping steps.

Exemple de résultat

Fourni par l'auteur
A. Summary | Migration | Verdict | Main risk | Expected blocking | | 20261102_add_shipped_at_to_orders | UNSAFE | NOT NULL with a volatile default (now()) → full table rewrite on 40M rows | writes blocked for minutes | | 20261102_index_orders_customer | SAFE WITH CHANGES | index built without CONCURRENTLY | writes blocked during the build | | 20261103_drop_legacy_ref | UNSAFE | old pods still select legacy_ref (OrderSerializer, line 31) | none, but errors during rollout | B. 20261102_add_shipped_at_to_orders Problem: on PostgreSQL a volatile default forces every existing row to be rewritten under an exclusive lock… Rewrite Deploy 1 (expand): add the column nullable, no default. ```sql ALTER TABLE orders ADD COLUMN shipped_at timestamptz; ``` Deploy 2 (migrate): backfill by id range, 10,000 rows per batch, short pause between batches, resumable from the last id… Deploy 3 (contract): add the NOT NULL constraint as NOT VALID, validate it separately… C. Runbook 1. Deploy code that writes shipped_at on new orders but tolerates NULL…

Fiche technique

Modèle
Claude
Langue du prompt
Anglais
Pour qui
Backend developers and tech leads shipping schema changes to production databases with live traffic
Longueur
~781 tokens (estimation)
Format livré
Texte du prompt, affiché en ligne après achat

Avis

Réservés aux acheteurs

Aucun avis pour l'instant. Seuls les acheteurs de ce prompt peuvent en laisser un.

Signaler ce prompt