System Design

Zero-Downtime Database Migration Pipeline

System Design diagram · made in Skemio

Architecture diagram illustrating zero-downtime database migration: API Gateway sends writes to an App Server, which dual writes to legacy and new tables while a backfill worker migrates historic rows.
Architecture diagram illustrating zero-downtime database migration: API Gateway sends writes to an App Server, which dual writes to legacy and new tables while a backfill worker migrates historic rows.

What it shows

  • Expand-and-contract pattern keeps backward compatibility during changes
  • Dual writes safeguard against data drift before cutting over reading logic
  • Background workers backfill cold rows asynchronously without table locks

The takeaway

Never rename or drop columns in-place; write new, backfill old, read new, then contract.

More system design diagrams