[Haskell-cafe] Data migration and software versioning

Corentin Dupont corentin.dupont at gmail.com
Sun Nov 30 12:04:15 UTC 2014


Hi the list,
I have some question relative to data migration.

Say you have a software in version A which save data in a file with format
FA. Later, you update your software to version B, with data format FB.
Now, if you want your version B of the software to be able to read data
saved by version A, you're obliged to include FA in version B, together
with some functions to translate from FA to FB.

This is what I don't find elegant: you're obliged to keep old code (data
formats) in your software.
-> do you know of any way to avoid keeping old data formats (for
retro-compatiblilty) in your code?

In practice I use acid-state with safecopy:
http://acid-state.seize.it/safecopy
In this example you can see the problem: the author is obliged to keep old
code (data structures) to maintain compatibility. Even worth, you might be
obliged to suffix your data structure with a version number:

data MyType_V1 = MyType_V1 Intdata MyType_V2 = MyType_V2 Integer


Instead, I'm thinking of a process using GIT, or Cabal as a back-end.
The idea would be to have an additional program (or library) specialized in
the data migration of your main software. It would extract both version A
and B from the repo, and then would compile an application capable of
handling migrations from FA to FB.

Does something like this exists (even outside of Haskell)?

Cheers,
Corentin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20141130/e27273c6/attachment.html>


More information about the Haskell-Cafe mailing list