Skip to main content
Optimize migration performance in your GitOps workflow.

Performance Optimization

Batch Large Data Migrations

For DML on large tables, process in batches:
Benefits:
  • Reduces lock contention
  • Prevents transaction log bloat
  • Allows monitoring progress
  • Can be paused/resumed

Use Online Schema Changes for Large Tables

For MySQL tables > 1M rows:

Online Schema Migration

Configure gh-ost for zero-downtime MySQL migrations

Optimize Index Creation

Create indexes concurrently when possible:
Note: CONCURRENTLY requires:
  • Cannot be in transaction block
  • Takes longer than regular index creation
  • May fail if concurrent writes conflict

Timing Considerations

Best times for migrations:
  • ✅ Low-traffic hours (nights, weekends)
  • ✅ During maintenance windows
  • ✅ After application deployments
Avoid:
  • ❌ Peak business hours
  • ❌ During critical operations (month-end, sales events)
  • ❌ Without communication to stakeholders

Monitor Migration Performance

Track execution time during development:
Set expectations for production:

Performance Monitoring

Track Migration Metrics

Monitor these metrics:

Database Health Checks

Before and after migrations:

Next Steps

Troubleshooting

Solutions for common GitOps issues

Online Schema Migration

Configure gh-ost for zero-downtime changes

GitOps Overview

Return to GitOps overview