Over a million developers have joined DZone.

The Definitive Guide to Database Version Control — Part 6

DZone's Guide to

The Definitive Guide to Database Version Control — Part 6

We went through the most popular methods for database version control 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 Zone ·
Free Resource

RavenDB vs MongoDB: Which is Better? This White Paper compares the two leading NoSQL Document Databases on 9 features to find out which is the best solution for your next project.  

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

[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.

Image title

[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.

Get comfortable using NoSQL in a free, self-directed learning course provided by RavenDB. Learn to create fully-functional real-world programs on NoSQL Databases. Register today.

database ,version control ,series ,change management

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}