GitOps with Database DevOps
GitOps is an operational framework that brings DevOps best practices—such as version control, collaboration, compliance, and CI/CD—into the realm of infrastructure and database automation. In the context of Harness Database DevOps, GitOps enables teams to manage schema changes with the same rigor and scalability as application code. You can apply GitOps principles in several impactful ways:
- Store configurations, database schemas, and migration scripts in Git repositories
- Use pull requests and peer reviews to manage and approve changes
- Trigger automated deployments through changes committed to Git
By integrating GitOps into your database lifecycle, you gain traceability, auditability, and reliable deployment workflows across all environments.
Implementation Approaches
When adopting GitOps for database management, two primary branching strategies are commonly used:
-
Environment-by-Branch
Each environment (e.g., dev, staging, prod) has a dedicated Git branch. Changes are promoted by merging from lower to higher environments. -
Trunk-Based Development
A single mainline branch (e.g.,main
ortrunk
) is used, with pipelines or metadata controlling environment-specific behavior.
→ Learn more
::: tip
If you're not currently using a GitOps-based branching approach, Harness recommends adopting trunk-based development. It simplifies change management, accelerates delivery, and aligns well with modern CI/CD and database promotion workflows. :::