Making Database Changes Faster & Safer with Quality Checks
English inventor Sir George Cayley made the earliest recorded proposal for a seatbelt in the mid 19th century. There was even a patent submission for seatbelts in the late 1800s for use in coaches and wagons. Seatbelts were available in automobiles soon after they were widely available, but adoption was almost non-existent until the middle of the 20th century. Even then, adoption wasn’t widespread until the introduction of laws that required people to wear them or pay a fine.
As a species, we don’t subscribe to the notion of “safety first” when it comes to innovation. We love to focus on creating. For some, “safety first” is a nuisance and impediment to the act of creating. We dream about going faster and only consider safety once we’ve figured out how to go faster. For technology to provide the most significant benefit to the broadest group of people possible, safety needs to become a primary concern. That’s why a lot of today’s vehicle marketing campaigns now hinge on crash ratings and airbags.
Quality Checks for Database Changes: A Seatbelt for CI/CD
With all of the recent advancements in CICD and release automation, the focus is always, “Do more stuff faster with less hassle.” This mantra works great for IT-driven innovation until your app won’t start, your performance tanks, or your database is MIA after an update. The long-term success of any investment in digital transformation depends on the ability to arrive at your destination safely. The trick is ensuring safe arrival with something as easy as fastening a seat belt. That’s why I’m excited about our new quality checks capability. Quality checks for database changes is a powerful safety feature that is so simple to establish that it quickly becomes second nature — just like fastening a seatbelt.
The long-term success of any investment in digital transformation depends on the ability to arrive at your destination safely.
Partnerships & Feedback Loops
Quality checks came into being as most things do at Liquibase — through partnerships with our community and customers. According to last year’s annual survey, the most valuable feature we could provide is the ability to detect security, data integrity, and compliance issues in database changes as early in the pipeline as possible.
This feedback didn’t surprise us. It confirmed the rules engine capability we implemented in Liquibase Enterprise years ago had as much value today as it did then. This time, we wanted to make it easier to use. We gathered direct feedback from more than 100 developers, DBAs, and DevOps professionals through interviews and surveys to better understand their needs. We learned a lot about their processes, the kinds of database changes that cause the most problems, and the best practices they have established to keep their databases available, stable, and performant. The result is a simple, flexible, and powerful capability that amplifies and accelerates the most important feedback loop in database development: the initial change approval process.
Using & Managing Quality Checks
Our research helped us arrive at the starting set of checks included in Liquibase 4.5. Developers, DBAs, and enterprise architects were primarily concerned with detecting changes that modify user and role privileges or introduce potentially destructive changes. With no configuration, the first time you run the Liquibase checks command, you’ll receive alerts for any SQL scripts and changesets that alter privilege configuration, drop tables, drop columns, or modify data types.
Additional quality checks allow you to enforce best practices to provide you with better control and tracking for your database deployments — ensuring that changesets include contexts, labels, or comments. With each release of Liquibase, we will expand the standard quality check library to cover more use cases. Some notable additions that are coming soon include enforcement of naming conventions, enforcement of data type usage, and more precise control over the kinds of privileges that are allowed or forbidden. View the list of available quality checks.
I love how easy it is to manage the quality checks capability. It’s simple to extend to the specific needs of your organization, team, or project. If any standard checks don’t appeal to you, it only takes a single, simple command to disable them for all future uses. If you have more specific needs around the kinds of SQL statements allowed, a template check lets you define patterns to look for in a flexible way.
You can create as many checks as you want from that template. In fact, we worked closely with one of our current customers to test out a real-world configuration scenario while we developed quality checks. Their team provided us with a list of checks they wanted to run before committing a new change or during the integration build process for new changes. In about 30 minutes, I was able to configure all of their customized checks. Quality checks configuration is file-based, so it’s easy to share in a source code repo, an artifact repo, or any physical or cloud-based storage solution. Every person or automation job working with their changelog can now validate it from a single, consistent source. The command structure is simple. It’s a breeze to integrate as a quality gate in existing automation.
Getting Started with Quality Checks
Download the latest version of Liquibase (v4.5) to start using the new checks command. Liquibase Community edition (open source) users are limited to 5 checks per changelog or changelog group. To get free, unlimited access to quality checks, request a Pro license key through our free 30-day trial. You’ll receive a key that you can paste right into your current Liquibase properties file.
For details on using the new command and configuring quality checks, see the documentation.
Let Us Know What You Think!
Our collaboration with our community of users, contributors, and customers doesn’t end with this release. I would love for you to try the capability, whether you are a long-time Liquibase user or completely new to database change management automation. If you have compliments, criticisms, questions, or ideas, we’d love to hear from you. Set up some time with me or a product on my team using our Calendly event or hit us up on the Liquibase forums or Discord channel.