-
Zero-downtime: Multiple releases of the code that understand different database schemas can simultaneously write to the database.
-
Triggers: Triggers are used to keep old and new schemas in sync while the application undergoes a rolling upgrade.
-
Expand-migrate-contract: The migration is performed in three phases. The expand phase creates new columns (and possibly tables), and triggers. The migrate phase moves data from the old column to the new column. The contract phase removes old columns (and possible tables), and triggers.
To demonstrate, run:
sh demo.sh
This was super useful. But I don't think it's actually zero-downtime the way its written?
If you keep receiving simultaneous requests while this is running, somethings probably going to break? Either/or the triggers no longer exist so you'll just get wrong data migrated.
Does sqlite use snapshot isolation consistency level for
?