Over a million developers have joined DZone.

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

Build fast, scale big with MongoDB Atlas, a hosted service for the leading NoSQL database. Try it now! Brought to you in partnership with MongoDB.

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.

Now it's easier than ever to get started with MongoDB, the database that allows startups and enterprises alike to rapidly build planet-scale apps. Introducing MongoDB Atlas, the official hosted service for the database on AWS. Try it now! Brought to you in partnership with MongoDB.

database,version control,series,change management

Published at DZone with permission of Yaniv Yehuda, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}