I've learned many ways to keep a domain model flexible over the years, but there is a remaining case where the setup resists change.
Suppose that we have kept our domain model properly isolated: we can change it easily. Now a change requires a fundamental restructuring of the domain model. There is one thing in our way: our persistent data structure will no longer fit the heavily-changed domain model.
In most cases, the data structure does remain usable, and may need only some minor adjustments. We can change our domain model, and then simply fix the translation to the classes that map to our data storage.
However, this is not most cases. Our data structure needs to change to accommodate the updated domain model. Let's also say we have a GB of data stored. (Should this be avoided to solve the problem? Definitely up for discussion.) After the change, we must still have that data, be it in its new form.
Particularly the updating of data to its new form seems to introduce an undesirable amount of work and risk.
How can we create a setup where the above scenario is easiest to manage? Particularly, it would seem good to minimize work and risk.
Feel free to apply whatever persistent data storage you deem most suitable.