News for hackers. Stuff that matters.
Re:Ask HN: How do you do slow migration with zero downtime? by viraptor on Sunday April 02, 2023 @06:13AM (#35409002)
It feels like with that amount of change, doing the actual full migration every time is a bit heavy. You'll have to do that of course for new keys, but for new fields have you thought of alternative approaches?

For example using a schema version field in a record, so that you can read v5, initialise "new_field" with the default value in the model, and write back as v6 if needed? (With an occasional update of everything so you can cleanup the code)

Or maybe create new tables for the new data and do a periodic merge as needed?

Hard to say without knowing more, but my first instinct here would be to ask if there's any other approach possible which doesn't require the migrations in the first place.

Re:Ask HN: How do you do slow migration with zero downtime? by edweis on Sunday April 02, 2023 @06:47AM (#35409178)
Indeed sometime migration can be avoided. Sometime it can't (like we need to encrypt all customer sensitive data for compliance).

Having field versions is interesting, very much like our "4-step migration" but lightweight.