Skip to main content
This guide provides battle-tested patterns and recommendations for production GitOps workflows with Bytebase.

What You’ll Learn

This best practices guide covers:
  • File Organization - Repository structures and directory layouts for different team sizes
  • Migration Guidelines - Version numbering strategies, file best practices, and common pitfalls
  • Git and CI/CD - Branching strategies, CI/CD patterns, and testing approaches
  • SQL Review and Security - Review configuration and security best practices
  • Performance and Drift - Optimization techniques and drift management

Who Should Read This

This guide is designed for:
  • DevOps Engineers setting up database CI/CD pipelines
  • Database Administrators migrating to GitOps workflows
  • Development Teams implementing database version control
  • Platform Engineers building self-service database platforms

Prerequisites

Before diving into best practices, you should have:

Quick Reference

Critical Best Practices

File Management:
  • Use timestamp-based versioning for parallel development
  • Keep migrations small and focused (one logical change per file)
  • Never modify applied migrations
Testing:
  • Always test in non-production first: Local → Dev → Staging → Production
  • Maintain test data that mirrors production
  • Test schema compatibility before deployment
Security:
  • Use service accounts for CI/CD
  • Grant least privilege database access
  • Store secrets in secret management systems
Performance:
  • Batch large data migrations
  • Use online schema changes for large tables
  • Create indexes concurrently when possible

Get Started