3 ms·
If downtime is permitted, I just write a script to migrate the data and run it. I prefer to write this script in SQL, but if that’s not possible I’ll just use H
by tofukid 5y ago
If downtime is permitted, I just write a script to migrate the data and run it. I prefer to write this script in SQL, but if that’s not possible I’ll just use Haskell or shell. Often I can use this approach with no downtime leveraging a proxy server/load balancer, if the migration is quick.
If zero downtime is required, I write the code to migrate the data to the new schema. Then update the app to write to the new schema while reading from old and new schemas. Then in a subsequent deploy after data is migrated, I write code that removes support for reading from the old schema.