6 Reasons You Should Try Liquibase for Your Next Project

Robert Reeves
4 min readDec 3, 2019

--

Database schema and logic changes are beyond difficult. As our applications become easier to develop and release, and the workflow we use to manage database change has not kept pace. This should not be the case. Database release tools are finally catching up to their application release counterparts.

Here are the top six reasons you should use a powerful open source tool, Liquibase, to help with database schema change, version control, and deployment for your next project.

You want to automate the drudgery

You have two different paths for application and database changes. For applications, a developer checks in a change, a build is triggered, the application is tested and then released. As an industry, we are automating this path more and more. For database change, manual effort (read: human mischief) and heavyweight change process are the norms.

Dr. Nicole Forsgren’s research shows that a heavyweight change approval process is a severe limiter for improving software delivery outcomes. However, that manual drudgery is not just slowing you down, it just plain sucks. The toil of managing approvals via a ticket system is an anti-pattern AND a soul-sucking rock fetch.

You like to iterate rapidly

The database is one of the biggest bottlenecks in software. Liquibase helps ensure software releases are always delivered with the matching state of the database so your features are deployed quickly and confidently. You’ll be gathering that user feedback instead of troubleshooting a bug because a column got dropped somewhere.

When we allow our developers to spend less time on internal processes, they spend more time writing and releasing code. When we write and release code faster, we have more chances to improve our software. When we improve our software, our customers are happy.

You don’t like losing data

Look no further than GitLab’s dropped production database. Thankfully, we have companies like GitLab who are transparent and detail their mistakes so they and the entire industry can learn. They detailed the manual steps that led to the production database being damaged.

Simply put, when you have a manual change, the chance for human mischief increases significantly. By using a tool like Liquibase to automate database schema migrations, you are able to test that the change is in all environments and know that the same results will occur. You’re not only testing the change with automation but you’re testing the method you use to apply the change.

You see multiple devs in multiple environments in your future

There is no merge and branch in your ticketing system. Thus, you should use the same functionality that works in handling a Java method merge conflict that you use for a stored procedure merge conflict. With the ticketing system, the last one committed will win and wipe out the previous changes.

With Liquibase, developers use a file that holds their proposed database changes. If there is a conflict with a table (or a trigger, or stored procedure, etc.) the developer will receive a merge conflict error. If for some reason, that doesn’t occur and there is a logical conflict (developer changes a table your bit of code depends on), automated testing will catch this in quick order and break the build.

You already have the tools that work wonderfully for managing multiple developers; you should also apply those tools to your database development.

You don’t like being locked into one type of database

Liquibase was created in 2006 to allow an ISV to not only automate database schema migration but to also apply that schema to different databases. Using your structured document of choice (XML, JSON, YAML), you can create changes that will not only update SQL Server but also Oracle. That makes Liquibase the best choice for software developers that must support multiple database vendors for their application.

You’re all for best practices, but like a backup plan

Yes, fixing forward is best. But databases rarely cooperate with your best-laid plans. Liquibase has rollback support built into the tool. For example, if you create a col umn and decide you don’t want it anymore and wish to create it with a different datatype or name, you can roll it back and Liquibase will drop the column.

Of course, that might not be what you want. You may wish to save the data in a newly created table. Thus, Liquibase allows for custom rollback scripts. Of course, because Liquibase can work with multiple database flavors with the same structured document, this takes the guesswork out of how to perform smarter rollbacks on each database you support.

Summing it up

TL;DR: Database schema migration tools like Liquibase are awesome additions to your project so you spend less time worrying about the database and more time developing features and incorporating real user feedback. It’s simple to get started with Liquibase, but it’s also important to point out that it’s also very powerful and includes features other database migration tools don’t have: rollback functionality, an easy way to snapshot and compare schema and stored logic changes, preconditions, labels, and contexts. While there are valiant efforts and workarounds for other tools, none handles them as gracefully as Liquibase from the get-go.

Give it a try and let us know what you think.

--

--

Robert Reeves

CTO @Liquibase, avid mixologist, semi-pro horticulturist, awful boarder, punk rock MBA, comic book literati, hubby badger, dad. #HookEm