Managing database migrations for multiple environments and teams can be challenging. This article describes how Git, database containers, and cloned databases, are combined for custom dev, test, and staging environments, each delivered in seconds.

While Git is often used with database containers, this approach introduces two new elements. Rather than restoring databases from backups, or building databases from source, identical secure production database environments are cloned and delivered in seconds. Database clones are writable, and easily incorporate data masking and synthetic test data. The second element is a script manifest file used in creation and application of personalized migration scripts.

A developer can work on a feature branch with a production database clone with feature scripts applied automatically. At the same time, testing can work on a release branch with an identical production database clone, with a set of release scripts applied. A pipeline stage can test a release branch rollback with a third identical secure production database clone, with upgrade and rollback scripts applied automatically.

This article focuses on SQL Server, but the same methods support Postgres and MySQL as well.

#database #docker containers #devops 2020 #database application development #git repositories

Automating Database Migrations With Containers and Git
1.10 GEEK