3 ms·
This seems like the right approach... We store persistent data in DBMSes, which have a schema defining the layout of our data, and use versioned migrations to u
by lukevp 6y ago
This seems like the right approach... We store persistent data in DBMSes, which have a schema defining the layout of our data, and use versioned migrations to upgrade the data. All new data either has optional parameters with default values for all new properties, or the app has to be taken offline and all versions upgraded at the same time to migrate.
It seems reasonable to reflect this practice in all state based data representations within a language, not just in an external system. Is the reason this isn't done as a first class citizen of language design because it's too much work to write migrators for every data structure change?
- agentultra 6y ago> because it's too much work to write migrators for every data structure change? I think that might be one factor. And writing that migration by hand would be another source of potential errors to sneak into your program without some static analysis to ensure the streams in your program are handling the version of the data specified. Making it easier to write migrators and have your whole program verified automatically has been working well for me.