40M Rows, Zero Downtime: How Database Migrations Work
DevDecoded
0:00 / 0:00
40M Rows, Zero Downtime: How Database Migrations Work
35 просмотров · 9 дн. назад
DevDecoded
3 подписчика
35 просмотров · 9 дн. назад
How do you change a production database without taking it offline? This video shows the two ways a migration causes an outage, and the three techniques that avoid it: native online DDL, gh-ost, and expand-contract.
Covers renaming a column without downtime, Postgres 11+ fast defaults, MySQL ALGORITHM=INSTANT, gh-ost vs pt-online-schema-change, and the Rails strong_migrations gem.
CHAPTERS
0:00 Intro
1:11 Why migrations break production
4:13 The deploy / migration timeline
5:18 The landscape of techniques
6:11 Native online DDL (Postgres, MySQL)
8:15 gh-ost
11:07 Expand-contract (rename a column safely)
14:18 Comparing the three
14:50 The Rails code
17:01 Real-world usage
18:22 Challenges and traps
19:40 Mental model and recap
WHO IT'S FOR
Backend engineers who ship schema changes to a live Postgres or MySQL database. It assumes you know basic SQL and what a rolling deploy is.
WHAT'S COVERED
Lock contention outages, schema-code version skew, backfills, dual-write drift, and why rolling back a schema is harder than rolling back code.
Follow DevDecoded for more system design, explained visually.