Backend concept

Schema Migrations

Expand-contract releases, backfills, dual writes, rollback safety, and zero-downtime database changes.

Practice this concept Review missed items Back to concept map

Key takeaway

Expand-contract releases, backfills, dual writes, rollback safety, and zero-downtime database changes. Start with the related games below when you want to turn the definition into practice.

Why this matters

Production schemas change while old and new application versions may run at the same time.

How to practice

Plan safe migration order before adding constraints or removing old columns.

0 active misses 0 reviewed 0 games completed

Local review for this concept

No local review items for this concept yet.

Start a focused review session for Schema Migrations.

Learning objectives

  • Apply expand-contract thinking to columns, renames, indexes, and constraints.
  • Plan backfills that avoid unnecessary locks and production load spikes.
  • Explain why schema changes must be compatible with mixed application versions.
  • Identify measured lock blockers.
  • Separate query evidence from retry amplification.
  • Sequence compatible schema changes and rollback decisions.

Common mistakes to avoid

  • Renaming or dropping a column while old app versions still use it.
  • Running huge backfills or index builds in the most blocking mode during peak traffic.
  • Adding constraints before all writers and old rows satisfy them.
  • Treating rollback as simple even after destructive schema changes.
  • Increasing pools before removing blockers.
  • Retrying a saturated database.

Games for Schema Migrations

Start with the first game, then use local review history to revisit missed decisions.

Databases Intermediate

Schema Migration Runbook

Choose safe zero-downtime database migration steps for expanding schemas, backfilling data, rolling out indexes, enforcing constraints, and recovering from failures.

Time
6-9 minutes
Concept
Zero-downtime schema migration planning and expand-contract releases
  • Data & Performance
  • Database Reliability
  • migrations
  • schema design
  • backfill
Play Schema Migration Runbook
Reliability Advanced

Slow Query & Change War Room

Triage blocking chains, slow-query regressions, expand-contract changes, and resource-safe database rollouts.

Time
10-12 minutes
Concept
Production database incident response
  • Data & Performance
  • Databases
  • Incidents
  • Schema Migrations
Play Slow Query & Change War Room
Databases Intermediate

SQL Index Quest

Choose the best database index for simplified schemas and queries while learning full scans, covering indexes, sort avoidance, and composite order.

Time
7-10 minutes
Concept
Database indexing and query performance
  • Data & Performance
  • Algorithmic Reasoning
  • SQL
  • indexes
  • performance
Play SQL Index Quest
Databases Advanced

Transaction Isolation Arena

Defend database invariants from concurrent requests by choosing transactions, locks, constraints, snapshot reads, and optimistic concurrency.

Time
7-10 minutes
Concept
Database transactions, isolation anomalies, locks, and invariant protection
  • Data & Performance
  • Database Reliability
  • SQL
  • transactions
  • isolation
Play Transaction Isolation Arena