Database Branching and Merging in a Git World
Git has radically changed our perspective on continuous delivery, branching and merging, on distributed development, and on the value of treating everything as code. Git users can rapidly branch and merge code to support non-linear development. With local repositories, Git supports widely distributed development teams that are no longer dependent on network resources. Environments are now being described in code stored in Git repositories. All of these benefits can be appreciated by both database developers and DBAs with just a few shifts in focus.
Shift 1: One Location for Changes
We must store all our environment changes (code, database schema changes, environment config) in Git. We can no longer have multiple systems of record. Prior to Git, we were slowed by the network requirements of other version control systems. We didn’t want to store substantial amounts of information in the repository because pulling it down took too long. Now with local repository access with Git, we see several orders of magnitude in performance improvement.
To that end, by storing our application code and database changes in one location, we can benefit from the atomicity of the change. We are no longer concerned with which version of the code changes go with which version of the database changes. Life is too short to have to worry about multiple systems of record.
Shift 2: No More Manual Reviews
Secondly, the manual review of database changes at every stage needs to stop. Nowhere in our software development lifecycle do we review code changes after a build and release to test. Sure, we have code reviews in development. And, thanks to Git’s rapid branch and merge capabilities, we can easily do that. However, we are not performing the same code reviews with our database changes.
Consider this: what impact would a System Administrator reviewing code changes prior to deployment have on our deployment times? Of course, deployment times would expand. However, I’m sure you are most concerned with why a system administrator is reviewing code changes. Commonly, we have database administrators who perform this same review.
Forcing a review of database schema changes at every point proves that your current process and tooling is unable to guarantee quality and safety of the change. Until you can, you are not moving at Git Speed.
Shift 3: Don’t Rely on SQL Scripts Alone
Finally, relying on SQL Scripts alone is foolish. The problems inherent to deploying SQL Scripts are twofold.
- The first issue that you are faced with incomplete execution of a series of scripts. You have no guarantee that your SQL Scripts will execute properly in a target environment. (Which probably explains why you are manually reviewing today.)
- Secondly, if there is a failure that requires rollback, you are left with manually exiting the deployment. Of course, you can mitigate that by requiring rollback scripts, but enforcing that is another headache and burden for an already overworked database team.
Bringing it all together
Liquibase can help you move your database changes to a Git world. With our ability to take advantage of Git’s capabilities we can do database branch and merge. This means you can quickly consume database changes from a variety of sources easily and efficiently. Our database change management simulator takes the guesswork out of change impact assessment allowing you to automate only the changes that will be successful. In addition, our database rules engine completely removes the manual review process by automatically enforcing standards you are currently doing by hand.
Want to learn more about extending branch and merge strategies for the databases?
Check out this whitepaper: Extending Branch/Merge Strategy to Database Changes
Automate BigQuery schema change and version control with database DevOps
Google's BigQuery is a fully managed, serverless cloud data warehouse, or database as a service (DBaaS), that brings unparalleled scalability and convenience to data analytics.
Ubuntu/Debian: A new & easier way to install Liquibase for Linux users
We're thrilled to announce a brand new installation method for Liquibase specifically designed for Ubuntu/Debian users. Say goodbye to the manual process of downloading the