Skip to main content
JobCannon
All skills

Database Migration Strategies

β¬’ TIER 3Tech
+$30–50k
Salary impact
5 months
Time to learn
Medium
Difficulty
2
Careers
AT A GLANCE

Database migrations are how teams safely evolve production schemas. Expert patterns: expand-contract (add column, backfill, drop), dual-write (shadow traffic), blue-green (switch databases), online DDL tools (gh-ost, pt-online-schema-change). Career path: Junior (basic migrations, Liquibase, 4-6 months) β†’ Senior (zero-downtime orchestration, $135-185k). Certification: AWS DBS Specialty, Liquibase certified, Flyway docs.

What is Database Migration Strategies

Database migrations are controlled schema and data evolution: adding columns, changing types, creating indices, backfilling data, and dropping old schema β€” all without downtime. The stakes are high: a bad migration can take production down, corrupt data, or cause prolonged recovery. Strategies span offline (downtime-required, simple rollback) to online (continuous traffic, complex tooling), frameworks (Liquibase, Flyway, Prisma Migrate), and deployment patterns (expand-contract, blue-green databases, shadow writes). Large-scale systems (100GB+ tables, billions of rows) require specialized tools (gh-ost, pt-online-schema-change, AWS DMS) and careful orchestration. Backend engineers who master migration safety command +$30–50k premium over those who cause production incidents. The salary impact is moderate (+$10–20k) but concentrated in senior/staff engineer roles where schema management defines infrastructure reliability. At scale (>$1B revenue), a single poorly-planned migration affecting 10k+ users = customer churn, SLA violation, and C-suite stress. Companies now hire "data platform" or "database reliability" engineers specifically to design safe migration frameworks. Stripe, Uber, Airbnb published case studies on zero-downtime migration patterns; mastering these patterns is expected for infrastructure-track engineers.

πŸ”§ TOOLS & ECOSYSTEM
LiquibaseFlywayPrisma migrateDrizzle migrategh-ostpt-online-schema-changeAWS DMSAzure DMSStriimDebeziumFivetranAirbyteSchemachange

πŸ“‹ Before you start

πŸ’° Salary by region

RegionJuniorMidSenior
USA$105k$155k$210k
UKΒ£65kΒ£95kΒ£140k
EU€75k€110k€155k
CANADAC$115kC$165kC$225k

🎯 Careers using Database Migration Strategies

❓ FAQ

Online vs offline migrations β€” what's the difference?
Offline: downtime required, lock tables, simple rollback. Online: serves traffic during migration, uses triggers/dual-write/shadow reads, more complex but zero-downtime. For large tables (> 100GB): always online. Tools: gh-ost, pt-osc (MySQL), Liquibase online config. Offline works for small tables or during maintenance windows. AWS DMS handles large cross-database migrations online with CDC (Change Data Capture).
How do dual-write patterns work?
Write new schema + old schema in parallel for 1-2 days, read from old schema. Verify new schema data matches. Flip reads to new schema. Drop old schema. Catches data inconsistencies before cutover. Risk: code complexity, schema mismatch bugs. Alternative: expand-contract (safer, slower).
Blue-green migration strategy β€” when should I use it?
Set up identical database clusters (blue=live, green=standby). Migrate green while blue serves traffic. Test green thoroughly. Flip traffic to green. Keep blue as rollback for 24h. Best for: cross-database migrations (Postgres→MySQL), major version upgrades, schema overhauls. Cost: 2x database cost during migration. Trade-off: safest approach, highest cost.
What's the expand-contract pattern?
Phase 1: ADD COLUMN new_column. Phase 2: backfill new_column from old_column via batch jobs. Phase 3: flip code to read from new_column. Phase 4: DROP COLUMN old_column. Each phase deployable independently. Slowest approach but safest β€” zero-downtime, reversible at each step. Used by Google, Facebook for massive tables.
Large table migrations (1TB+) β€” tactics?
Never LOCK TABLE. Use gh-ost (online DDL, triggers, shadow table) or AWS DMS (CDC + replication). Chunk data with row IDs in batches (10k rows/sec). Monitor replication lag. For index changes: rebuild online or drop+recreate in parallel. Test on production-sized replica first. Budget: hours to days depending on table size.
Rollback strategies for failed migrations
Test rollback plan BEFORE migrating: reverse migration scripts, backup-restore window, CDC rewind (Debezium). Keep last 7 days snapshots. For expand-contract: rollback = revert code, old column still there. For blue-green: instant (flip traffic back). For online DDL: rollback = abort tool, old table preserved. Document rollback SLO per migration type.
Cross-cloud migrations (AWS Postgres to Azure)
Use AWS DMS (source) + replication β†’ Azure. Or Fivetran/Airbyte for data sync + custom schema migration. Schema-first approach: migrate DDL via Liquibase, then data. Test on non-prod first. Network latency matters: direct connection > VPN. 1TB takes 8-24h depending on latency. Plan cutover window. Verify foreign keys, sequences, triggers exist on target.

Not sure this skill is for you?

Take a 10-min Career Match β€” we'll suggest the right tracks.

Find my best-fit skills β†’

Find your ideal career path

Skill-based matching across 2,536 careers. Free, ~10 minutes.

Take Career Match β€” free β†’