How do online schema change tools work?
PlanetScale PlanetScale
37.7K subscribers
3,386 views
0

 Published On Apr 23, 2024

Running database migrations / schema changes often leads to table locking and downtime. For mission-critical applications that can't take any downtime, or apps with huge tables where schema changes take several hours, this is bad news. The way to get around this is by using online schema change tools, such as gh-ost, pt-online-schema-change, or Vitess online DDL.

At a high level, these tools work by copying the original schema onto a new table known as a shadow table. The data is copied over to the shadow table, and once they're close to in sync, the tables are swapped. This video covers this whole process step by step, as well as what it looks like to run schema changes without these tools.

00:00 Intro
01:50 Schema change locking demo
03:50 Intention, shared, and exclusive locks
06:47 Intro to online schema change tools
07:24 Schema change demo in PS without online DDL
09:36 Online schema change demo
13:24 How do online schema change tools work?
25:23 Reverting a schema change
26:11 How do schema reverts work?
28:11 MySQL instant DDL
28:55 PlanetScale gated deployments, deploy requests, and reverts

To learn more about PlanetScale, head to https://planetscale.com/youtube!

💬 Follow PlanetScale on social media
• Twitter:   / planetscale  
• Discord:   / discord  
• TikTok:   / planetscale  
• Twitch:   / planetscale  
• LinkedIn:   / planetscale  

show more

Share/Embed