loading...

How do you cope with database migration?

markomannux profile image Marco Mannucci ・1 min read

I find databases (mostly the relational one) to be one of the components more adverse to change in a software system. That's even worse if there some kind of ORM between the tables and the data model in our application.

There's always some resistence in altering a database, especially in a consolidated product that is already live in production.

With database migration I mean every operation needed to handle the porting of a database from its current version to some new version, maybe after introducing some new feature in the app that impact the data schema.

So I'm talking about versioning, scripts, data import and update, dedicated automation etc.

I'm a long time user of Liquibase for this kind of stuff, but I find it a little cumbersome in its usage and painfully slow when there are lot of migrations to analyze (I'm using it in it's Groovy flavour, maybe it depends on that).

Recently I explored Active Record migration and found it quite refreshing, although I think it's a bit tied to Rails (where Liquibase it's more obiquitous).

I'm curious to hear what are your tools and strategies to cope with database migration.

Discussion

pic
Editor guide