12735 shaares
315 private links
315 private links
How to do a migration properly without downtime? Avoid a transaction on all rows.
Method:
- add new column as nullable
- new writes use the new column and read from the old-and new columns
- Deploy
- Fix the old data in a batch. Pause briefly between each batch and run another one once the database load is correct.