Microsoft Certified: DevOps Engineer ExpertDesign and implement pipelinesMedium
A global e-commerce company uses Azure DevOps to manage its release pipelines for a critical web application. They need to ensure that database migrations are applied correctly and consistently across all environments (staging, production) as part of their deployment process. The migrations should be reversible, and the system must track which schema versions are deployed to each database. Which tool or approach is best suited for this requirement?
- AEmbedding SQL commands directly in the Azure Pipeline YAML
- BUsing a schema migration tool like Flyway or Liquibase
- CAzure Data Factory pipelines for database updates
- DManual SQL scripts execution
Show answer & explanationAnswer & explanation
Correct answer: B. Using a schema migration tool like Flyway or Liquibase
Schema migration tools like Flyway or Liquibase are specifically designed for managing database schema changes. They track applied migrations, ensure consistency, support rollback, and integrate well into CI/CD pipelines, directly addressing all requirements.
Why the other options are wrong
- A. Embedding SQL commands directly in YAML lacks proper version control for schema changes, makes rollbacks difficult, and is not a robust solution for managing complex database evolutions.
- C. Azure Data Factory is primarily for data movement and transformation, not for managing database schema versioning and migrations within a CI/CD context.
- D. Manual SQL scripts are prone to human error, lack version tracking, and are difficult to integrate consistently into automated pipelines.
Database Schema Migration Tools
Tools (e.g., Flyway, Liquibase) that manage the evolution of a database schema by applying version-controlled migration scripts, ensuring consistency and enabling rollback capabilities.
- Version control for database schemas.
- Ensures idempotent and consistent migrations.
- Supports rollback to previous schema versions.
- Integrates with CI/CD pipelines for automated deployments.
Memory trick: Database schemas need a migration tool to grow up gracefully, not haphazardly.