DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
View Events Video Library
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Integrating PostgreSQL Databases with ANF: Join this workshop to learn how to create a PostgreSQL server using Instaclustr’s managed service

Mobile Database Essentials: Assess data needs, storage requirements, and more when leveraging databases for cloud and edge applications.

Monitoring and Observability for LLMs: Datadog and Google Cloud discuss how to achieve optimal AI model performance.

Automated Testing: The latest on architecture, TDD, and the benefits of AI and low-code tools.

Related

  • 7 Essential Tools for a Competent Data Scientist
  • A Better Web3 Experience: Account Abstraction From Flow (Part 2)
  • Training a Handwritten Digits Classifier in Pytorch With Apache Cassandra Database
  • Automated Testing: The Missing Piece of Your CI/CD Puzzle

Trending

  • What Technical Skills Can You Expect To Gain From a DevOps Course Syllabus?
  • Using Open Source for Data Integration and Automated Synchronizations
  • How To Simplify Multi-Cluster Istio Service Mesh Using Admiral
  • Graph Databases: Unleashing the Power of Relationships
  1. DZone
  2. Data Engineering
  3. Databases
  4. The Definitive Guide to Database Version Control – Part 2

The Definitive Guide to Database Version Control – Part 2

In part one we reviewed how the methods for creating software evolved into Agile and DevOps and how automation is based on version control.

Yaniv Yehuda user avatar by
Yaniv Yehuda
·
Dec. 10, 15 · Tutorial
Like (3)
Save
Tweet
Share
4.53K Views

Join the DZone community and get the full member experience.

Join For Free

This is part two of a seven-part series on database version control. In part one we reviewed how the methods for creating software evolved into Agile and DevOps and how automation is based on version control. We will now discuss why version control for the database is a key component of DevOps. We will go through the most popular methods being used and the shortfalls of each. We will then reveal the correct way to practice database version control in order to maximize value and eliminate risk to the organization.

Most IT applications today have many components using different technologies, such as mobile, ASP, PHP, application servers, Citrix, databases, etc. These must all be in sync for the application to work. If, for example, a new column was added to a table, or a new parameter was added to a stored procedure, all other application components must be synchronized to the structure change in order to function correctly. If this synchronization breaks, then the application can fail by calling the wrong parameters to the stored procedure, or by trying to insert data without the new column.

The unique properties of the database component differentiate it from other components:

  • A database is more than just SQL scripts. It has a table structure, code written in the database language within stored procedures, content that is saved in reference tables or configuration tables, and dependencies between objects.
  • A database is a central resource. Several developers can work on the same object, and their work must be synchronized to prevent code overrides.
  • Deploying database changes is not as simple as copying and replacing old binaries. Database deployment is the transformation from version A to version B, while keeping the business data and transforming it to the new structure.
  • Database code exists in any database, and can be modified directly in any environment. This is unlike other components, where everything starts from a clean workspace in the build server.
  • database changes


    Must-Have Requirements


    There are several challenges that must be addressed when managing database changes. You must:

    • Ensure all database code is covered (structure, code, reference content, grants)
    • Ensure the version control repository can act as the single source of truth
    • Ensure the deployment script being executed is aware of the environment status when the script is executing
    • Ensure the deployment script handles conflicts and merges them
    • Generate a deployment script for only relevant changes
    • Ensure the deployment script is aware of the database dependencies


    In part three of the series, we will examine the most basic method for managing database changes, which is to save the alter command in a script or set of scripts, and manage them in the existing file-based version control. We will see if this method overcomes the challenges for the database.

    Database Version control

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

    Opinions expressed by DZone contributors are their own.

    Related

    • 7 Essential Tools for a Competent Data Scientist
    • A Better Web3 Experience: Account Abstraction From Flow (Part 2)
    • Training a Handwritten Digits Classifier in Pytorch With Apache Cassandra Database
    • Automated Testing: The Missing Piece of Your CI/CD Puzzle

    Comments

    Partner Resources

    X

    ABOUT US

    • About DZone
    • Send feedback
    • Careers
    • Sitemap

    ADVERTISE

    • Advertise with DZone

    CONTRIBUTE ON DZONE

    • Article Submission Guidelines
    • Become a Contributor
    • Visit the Writers' Zone

    LEGAL

    • Terms of Service
    • Privacy Policy

    CONTACT US

    • 3343 Perimeter Hill Drive
    • Suite 100
    • Nashville, TN 37211
    • support@dzone.com

    Let's be friends: