ServiceNow and GitHub Integration for Database Change Automation
Bytebase - Database CI/CD and Security at Scale
Leading open source database DevSecOps solution for Developer, Security, DBA, and Platform Engineering team.
Originally posted in https://www.bytebase.com/blog/database-change-automation-github-servicenow-integration/
Hi and welcome to Database DevOps Academy #83! We share Database DevOps insights and best practices for modern engineering organizations weekly. ??
In Issue #83, we explored the database change approach maintaining both the governance requirements through ServiceNow and the developer-friendly workflow in GitHub. ??
Why ServiceNow
Many enterprise organizations have adopted ServiceNow as their centralized IT Service Management (ITSM) platform. Database changes demand robust approval workflows and comprehensive audit capabilities. ServiceNow has emerged as the industry standard for managing all types of approvals, including critical database changes that can impact business operations.
Traditional ServiceNow Database Change Workflow
Above diagram illustrates the conventional workflow for database changes in using ServiceNow:
This structured approach ensures governance and compliance but often introduces delays due to manual handoffs and creates opportunities for miscommunication between technical and business stakeholders.
The GitOps Way
The GitOps model offers an alternative approach to database change management that leverages software development best practices:
The primary advantage of this approach is full automation, significantly reducing manual effort and human error. Changes move from development to production without manual intervention, accelerating delivery timelines and ensuring consistency across environments. Additionally, all changes are permanently documented in the Git history with clear authorship and reasoning.
However, the GitOps approach has limitations:
Version control system vendors like GitHub have recognized this disconnect between developer workflows and enterprise governance requirements. In response, GitHub has developed integration capabilities that allow organizations to leverage the strengths of both approaches through ServiceNow GitHub Actions and deployment protection rules.
Optimal Database Change Workflow
We can combine ServiceNow for approval and GitHub for GitOps to get the best of both worlds, leveraging ServiceNow's robust governance capabilities alongside GitHub's developer-friendly workflows. This integration can be further enhanced by bringing in Bytebase that provides dedicated database CI/CD.
The integrated workflow operates as follows:
Developer Initiates Change: A developer creates a Pull Request (PR) in GitHub containing the database changes.
Automated Integrations Triggered:
a. A GitHub Action or custom App creates a ServiceNow change request, ensuring governance requirements are met.
b. Simultaneously, Bytebase SQL Review is triggered to analyze the SQL scripts, providing automated technical validation (Sample PR).
Multiple Approval Gates Enforced:
a. PR merge is blocked pending Bytebase SQL review results.
b. Technical lead or peers must review and approve the PR in GitHub.
c. The ServiceNow approval flow, including CAB review with managers and stakeholders, must be completed.
PR Merge: Once all pre-conditions are satisfied (SQL Review, peer approval from GitHub, and business approval via ServiceNow), the PR is merged.
Deployment Workflow Creation: Merging triggers Bytebase GitHub Actions to create a deployment workflow.
Optional Deployment Protection Rules:
Vendor specific support. GitHub provides deployment protection rules. Azure DevOps provides pipeline approvals and checks.
a. Additional safeguards can be implemented requiring technical lead manual rollout approval.
b. ServiceNow approval may be required again at the deployment stage for critical environments.
Database Change Deployment: After all deployment protection rules are satisfied, Bytebase executes the database change deployment.
The benefit of this integrated approach is that each system handles what it does best. Bytebase, as a dedicated database change management tool, excels at database-specific tasks that neither GitHub nor ServiceNow can natively provide:
The combined approach gives database administrators and engineers deep visibility into database evolution while still maintaining the governance requirements through ServiceNow and the developer-friendly workflow in GitHub.
Beyond Database Change Automation
Besides complementing ServiceNow and GitHub for database change automation, Bytebase also provides a web-based SQL Editor that facilitates Just-in-Time database access control and applies dynamic data masking on the fly when querying the database. Thus, you can standardize database change and query process in a single place.