Flyway development and deployment pipelines
Published 28 October 2022
Flyway comes in three editions, each suited to different needs.
Flyway Community | Flyway Teams | Flyway Enterprise |
---|---|---|
Perfect for individual developers, or non-commercial projects looking for a basic and reliable framework for versioning and automating the deployment of database changes | Ideal for organizations looking to improve collaboration and fine tune their processes during development and the deployment of database changes | Ideal for medium and large enterprises who require secure and automated processes with compliance controls to develop, test and deploy database changes |
Flyway and its role in supporting the development and deployment process
The extent to which Flyway contributes to an organization's chosen database development practices, and the accompanying automated delivery pipeline, varies depending on the Flyway edition.
Agile Database Development
Flyway provides a development experience as well as an automated deployment pipeline capability. Flyway Enterprise provides the richest experience, both in the productivity gains, as well as providing the most integrated and flexible development and automated deployment workflow.
Flyway Community doesn't provide object-level versioning, and requires developers to manually author migration scripts. As the migration scripts are the only artifact that is version controlled, these need to be created early in the process to ensure the development is safeguarded. This could be problematic if the order of deployment matters, and isn't known up front, as Flyway deploys migration scripts in order. A more flexible approach is provided by Flyway Teams and Flyway Enterprise, which allows the database object changes to be saved and versioned without requiring a corresponding migration script to be created yet.
Flyway Community has no support for undo scripts, so if this is a requirement, Flyway Teams (manual undo script creation) or Flyway Enterprise (auto-generation of undo scripts) should be considered.
Flyway Teams provides object-level versioning, unlocking many benefits of version control, such as an audit trail of what changed, who made the change and why, and the ability to recover historic states of the objects. But unlike Flyway Enterprise, although Flyway Teams offers a CLI to execute migration scripts, it is not equipped with the capability to automate the generation of SQL scripts for deployment or roll back. This means that for teams wanting migrations-based deployments, the authoring of migration scripts and roll back scripts remains a fully manual exercise, and for teams wanting automated state-based deployments, Flyway Enterprise needs to be employed.
Flyway Enterprise adds static data versioning to the database objects that are versioned. Development teams are now equipped with an advanced automated script generation capability, providing huge productivity gains in generating migrations scripts based on any changes to schema and static data changes detected in development. In a state-based deployment model, these scripts are generated dynamically at deployment time, and in a migrations-based model they are generated by developers, which leaves room for script customization, where required. An advanced set of code analysis checks are available to ensure team development standards are being met.
Note that the full set of Flyway Enterprise capabilities is available for SQL Server, Oracle and Postgres and MySQL.
Community | Teams | Enterprise | |
---|---|---|---|
Flyway Desktop GUI and CLI | ✓ | ✓ | ✓ |
Built-in Git client | ✓ | ✓ | |
Database object-level version control | ✓ | ✓ | |
Static data versioning | ✓ | ||
Migration scripts | self-authored | self-authored | auto-generated |
Deployment warnings | ✓ (coming soon) | ||
Undo script auto-generation | ✓ | ||
Identify database changes missing from migrations | ✓ | ||
Code analysis – code standards | Basic rule set | Standard rule set (roadmap) | Advanced rule set and custom rules |
On-demand clones for dev and test instances - available if you partner Flyway with Redgate Test Data Manager | ✓ | ||
Spin up database when switching branches - available if you partner Flyway with Redgate Test Data Manager | ✓ | ||
Schema and data comparison tools | ✓ | ||
Automated CI/CD pipelines
Flyway includes capabilities in support of safe and reliable database deployment automation.
Flyway Community is equipped with a CLI, which allows for a simple flyway migrate to be run to automate deployments. No testing or validation is provided to provide confidence that a deployment will execute as expected.
Flyway Teams can output a "dry run" script, which shows the aggregated set of migration scripts that are to be run against the target. Athough this can be used as part of a pre-deployment review/approval process, understanding what changes will be made by inspecting the SQL alone is tedious at best.
Flyway Enterprise provides a comprehensive set of reports and checks to equip DevOps teams and DBAs with the confidence they need within their continuous delivery pipeline. Confidence can be gained in the knowledge that migration scripts are generated by Redgate's tried and tested comparison tech. Where DBAs need to review and approve a deployment, a detailed change report accompanies the dry run script, listing all the changed objects and detailing and highlighting the precise changes that are to be effected. A code analysis report will spot other potential red flags that may be of interest to a DBA. Although organizations try to avoid it, "production drift" can occur "out of process", which is highlighted to the DevOps team and DBA via the drift report, as it is possible that if production differs from the earlier pipeline environments, this could compromise the success of a deployment.
With Redgate Test Data Manager, full database clones with production-like data can be spun up at different points in the pipeline to ensure realistic testing, further instilling confidence that the deployment to production itself will be successful.
If the worst happens and a rollback is required, the existence of undo scripts (also auto-generated by the comparison technology) will support a speedy rollback (or roll forward, depending on the circumstances).
Community | Teams | Enterprise | |
---|---|---|---|
Deployment approaches supported | Migrations | Migrations | Migrations and State |
Find invalid objects | (on the roadmap) | ||
Deployment script preview | ✓ | ✓ | |
Database objects changes report | ✓ | ||
Code analysis | ✓ | ✓ (advanced and customizable rules) | |
Drift report | ✓ | ||
Provision build and test clones - available if you partner Flyway with Redgate Test Data Manager | ✓ | ||
Run deployment rehearsal on production data - available if you partner Flyway with Redgate Test Data Manager | ✓ | ||
State-based deployment warnings | ✓ | ||
Deploy migration scripts | ✓ | ✓ | ✓ |
Undo scripts | Self-authored | Generated | |
Other benefits of Flyway Enterprise
Community | Teams | Enterprise | |
---|---|---|---|
Database version support | Current databases only (5 years from release) | Standard support | Extended support |
Secrets management | ✓ | ||
Product support | Community support only | Redgate standard support | Premium support (roadmap) |