Pretty often I have a need to migrate the location where some data is stored - to a new column, a new table, or even a new data store. And usually this needs to be done with no down-time. I can see two approaches. Either:
- Change all live writers to write new data to both locations
- Do a one-time migration of data from the old location to the new location
- Change all readers to read data from only the new location
- Stop writing new data to the old location
or:
- Change all readers to read data from both locations, preferring the new location
- Change all writers to write new data to only the new location
- Do a one-time migration of data from the old location to the new location
- Stop reading data from the old location
I'm curious to hear thoughts or experiences on which approach is preferable, or if they have pros and cons. Is one or the other a more established practice?