This is part six of a seven part series on database version control. In part one, two, three, four, and five we reviewed how the methods for creating software evolved into Agile and DevOps, what separates the database from application code and the challenges that must be addressed when managing database changes. We then went through the most popular methods being used and the shortfalls of each.
We will now reveal the correct way to practice database version control in order to maximize value and eliminate risk to the organization.
Database enforced change management combines the enforcement of version control processes on the database objects with the generation of the deployment script when required based on the version control repository and the structure of the environment at that time.
This approach uses build and deploy on-demand, which means the deploy script is built (generated) when needed, not as part of development. This allows for efficient handling of conflicts, merges, and out-of-process changes.
[Build & Deploy On-Demand]
How does database enforced change management handle the challenges?
✔ Ensures all database code is covered – structure, business logic written in the database language, reference content, database permissions, and more are managed.
✔ Ensures the version control repository can act as the single source of truth – the enforced change policy prevents anyone (developers, DBAs) using any IDE (even command line) from modifying database objects which were not checked-out before and checked-in after the change. This guarantees that the version control repository will always be in sync with the definition of the object at check-in time.
[Single Process Enforcing Version Control]
✔ Ensures the deployment script being executed is aware of the environment status when the script is executing – building (generating) the deployment script when needed (just before executing) guarantees it is aware of the current environment status.
✔ Ensures the deployment script handles conflicts and merges them – by using baselines in the analysis, the nature of the change is known and the correct decision whether to promote the change, protect the target (ignore the change), or merge a conflict is easy.
[Baseline Aware Analysis]
✔ Generates deployment scripts for only relevant changes – the integration with application lifecycle management (ALM) and change management systems
(CMS) enables you to assign a reason to the change, as is done in the file-based version control or task management system.
✔ Ensures the deployment script is aware of the database dependencies – the sophisticated analysis and script generation algorithm ensures the DDLs, DCLs, and DMLs will be executed in the correct order based on the database dependencies, including inter-schema dependencies.
In addition to the must-have requirements, there are also further requirements, such as supporting parallel development, merging branches, integrating with the database IDE, and supporting changes originating from data modeling tools. You must verify that these requirements will be addressed by whichever method you choose.
In the seventh and final part of the series, we round things up and provide an easy-to-use comparison chart of the four methods for managing database changes, and the advantages provided by each.