Migrating data from an existing store to a new one.
The migration of data can be broken down as follows:
- Encapsulate access to the data in an appropriate data type.
- Modify the implementation to store data in both the old and the new stores.
- Bulk migrate existing data from the old store to the new store. This is done in the background in parallel to writing new data to both stores.
- Modify the implementation to read from both stores and compare the obtained data.
- When convinced that the new store is operating as intended, switch to using the new store exclusively (the old store may be maintained for some time to safeguard against unforeseen problems).
Facebook has used this process to transparently migrate database tables containing hundreds of billions of rows to new storage formats.