Home / Companies / PlanetScale / Blog / Post Details
Content Deep Dive

Behind the scenes: How schema reverts work

Blog post from PlanetScale

Post Details
Company
Date Published
Author
Holly Guevara, Shlomi Noach
Word Count
1,772
Language
English
Hacker News Points
-
Summary

The new feature allows for instant reverting of recently deployed schema changes without losing data written to the original schema during the deployment period. This is made possible by leveraging Vitess' VReplication internals, which tracks progress and incoming changes with exact precision using MySQL GTID (Global Transaction Identifier). The process involves creating a shadow table, applying the schema change, syncing data, and then switching back to copying from the production database. Once the data is copied over, the original table is swapped away and replaced by the shadow table, allowing for seamless revert without downtime or data loss.