News for hackers. Stuff that matters.
Re:Database Version Control with Liquibase by sz4kerto on Thursday September 24, 2020 @08:19AM (#24577850)
This is what Liquibase does. It does some other stuff for you as well, quite simple ones, but time has proven (to me/us) that they're all useful in real-life scenarios:

- exclusive lock to prevent multiple instances running at the same time

- rollbacks

- forcing immutability

> Then spends two days fiddling with config files to get it working.

Look, dozens and dozens of developers have been using this for many years at us without problems. If it takes two days to set it up: let it be.

And we're writing our migration scripts in SQL, not XML.

Re:Database Version Control with Liquibase by mumblemumble on Thursday September 24, 2020 @10:13AM (#24578780)
So, having used both, I've got to say, I had fewer problems with the homegrown solution.

Liquibase has its share of gotchas, especially in the SQL syntax. My sense is that most of the problems I experienced had to do with weird edge cases introduced by trying to handle some complex enterprisey scenario that I would rather deal with by just not letting things get that complicated in the first place. That exclusive lock mechanism, for example, isn't foolproof, and I suspect that it has bitten me more times than it's helped me.

-but-

Roll-your-own is not necessarily the easy option. I'd say that, if your goal is to get something robust enough to use in production, a day to implement is a very optimistic estimate. I'd say that it's one to steer clear of unless you're sure you know what you're doing.

Which one is better depends, as usual, on your situation. I think my rubric would probably be: If the XML schema definition language is at all attractive to you, use Liquibase (or similar). That's far and away its most unique contribution. If, on the other hand, the knowledge that anyone would even consider defining their SQL schema in a language other than SQL fills you with holy rage, maybe choose an option that sits closer to the metal. This doesn't necessarily need to be DIY project, but, thanks to Zawinski's Law, that might be the only way to ensure that your solution also stays close to the metal.