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.
Join the DZone community and get the full member experience.Join For Free
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:
- Package database schema changes alongside application code
- Simulate or rehearse database deployments to forecast potential errors
- Know the deployment status of every schema in the database
- Integrate with popular DevOps tools
More information on Datical DB can be found here.
Opinions expressed by DZone contributors are their own.