Database CI/CD

Rolling back changes in a database can be a complex and risky task due to the potential for data loss. Unlike other software changes, database changes involve manipulating critical data that may have dependencies across multiple applications or systems. Reverting these changes may require a detailed understanding of the database structure, schema, and the relationships between data elements. Additionally, some changes may be irreversible or have unintended consequences that can impact the system's stability and performance. Therefore, thorough testing and validation of database changes are crucial to minimize the risk of data loss and ensure the integrity and availability of the system.

CI/CD explained

CI/CD automates your builds, testing, and deployment so you can ship code changes faster and more reliably.
Automation is a core principle for achieving DevOps success and CI/CD is a critical component. CI/CD comprises of continuous integration and continuous delivery or continuous deployment. Put together, they form a “CI/CD pipeline”—a series of automated workflows that help DevOps teams cut down on manual tasks:
  • Continuous integration (CI) automatically builds, tests, and integrates code changes within a shared repository; then
  • Continuous delivery (CD) automatically delivers code changes to production-ready environments for approval; or
  • Continuous deployment (CD) automatically deploys code changes to customers directly.
To deliver new software experiences more quickly to market, companies have spent the last decade trying to modernize the way they build and deliver software. In their efforts to modernize and improve the continuous delivery pipeline, many tools have focused on bringing CI and CD to application code. However, the same has not happened for database code.

Database continuous integration (database CI)

Database continuous integration (CI) is the practice of frequently and automatically integrating database schema and logic changes into application development processes, enabling developers to receive prompt feedback on any issues that may arise. Building on this concept, database continuous delivery (CD) aims to deliver release-ready database code in small, iterative cycles.

Database continuous delivery (database CD)

Database continuous delivery (CD) is a process that focuses on getting changes for new features, updates, and bug fixes into production and to the users as safely and quickly as possible. This is achieved by streamlining the development process and keeping application code and database code in a deployable state.
The goal of continuous integration and continuous delivery (CI/CD) is to reduce time-to-market and create a steady stream of end-user value with frequent, high-quality software releases.

Database CI/CD flow using Metis

Metis focuses on the Test and Monitor steps

Test - Before deployment of new code

  • Analyze the performances of SQL Commands - use Metis SDK to send distributed traces of REST commands, SQL commands and their execution plans. Tag all the traces generated in a CI/CD pipeline to focus on the relevant traces only and easily distinguish them from the many other traces. The Metis Web App shows the Pull Requests and their analysis.
  • Schema Migration Analysis - Let Metis review the planned changes in the database.
  • Run tests on a copy of the Production DB (Coming Soon) - to increase confidence the planned pull request will not cause performance or application errors, run the tests on a copy of the production DB.

Monitor - After the Deployment