Over a million developers have joined DZone.

Liquibase for DBAs

With the DBA role becoming more complex, automation is key to getting the job done. Check out Liquibase's strengths and see if it might be helpful in your toolset.

· Database Zone

Sign up for the Couchbase Community Newsletter to stay ahead of the curve on the latest NoSQL news, events, and webinars. Brought to you in partnership with Coucbase.

The role of the Database Administrator is evolving and has never been more complex. DBAs are constantly juggling schema management, performance tuning, change control, plus database administration all within ever-shortening application development cycles. On top of all that, there are more database environments to manage than ever before, more distributed sources of database changes, and more stringent compliance requirements.

It is easy for database changes to get lost or misapplied along the way, and far too often the place where problems are found is in production. Fortunately, Liquibase can automate the database deployment process while still giving DBAs the control they need. In addition, Liquibase works alongside the database professional's preferred toolset.

No Change Is Forgotten

Liquibase tracks which changelog statements have run against each database, so DBAs no longer have to manually track which SQL statements have been run and which have not.

Like SQL? Use SQL

XML-formatted changelogs have their advantages, but many DBAs still prefer good old fashioned SQL. If that is what the team is most comfortable working with, Liquibase-formatted SQL provides the standard changeSet tracking used in any changelog format, but lets the DBA specify the exact SQL that is desired.

Manually Verify the Database Changes With Each Release

Liquibase supports an “updateSql” command that will not actually update the database, but instead output the SQL that will run. That script can be read and verified to ensure everything is correct and performing as expected.

Once everything is correct, DBAs can either run a Liquibase update or run the script through their favorite tools. The script will include the DATABASECHANGELOG inserts so everything will still be correctly tracked.

Prepare for Deployment Problems

Releases don’t always go as planned, so Liquibase ensures contingency plans are correct before each release. As teams get closer to releasing new application updates, besides checking the updateSql output, DBAs can also run futureRollbackSql which will output the SQL needed to bring a fully updated database back to the current state. It will be much less stressful verifying the rollback logic before the release.

A Unified Changelog for All Your Databases

DBAs try to keep all databases the same, but there are always differences. QA needs test data, production gets a couple extra tables, and the hot-backup server needs extra configuration. Liquibase supports contexts, labels, parameters, and preconditions that let database professionals address minor differences in scripts to adjust things as needed.

  • Contexts and labels target certain changeSets to run in only some environments.
  • Parameters perform simple text substitutions when things like schema names vary from database to database.
  • Preconditions check the state of the database to dynamically determine if a changeSet should be executed or not.

Thanks to Liquibase’s cross-database support, DBAs can even use a single changelog that supports Oracle, MS SqlServer, Postgresql, and more.

Enterprise Features With Datical

If your DBAs determine their needs extend beyond all the great capabilities Liquibase offers, then check out Datical.  Datical builds upon Liquibase and lets DBAs:

More information on Datical DB can be found here.

The Getting Started with NoSQL Guide will get you hands-on with NoSQL in minutes with no coding needed. Brought to you in partnership with Couchbase.

Topics:
liquibase ,dba ,database administrator ,database administration ,relational database ,database schema ,database change management ,database changes

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}