Choosing the right approach with Flyway
Published 23 May 2024
Flyway gives teams the flexibility to adopt a migrations-based approach, a state-based approach and to blend elements of both, according to individual needs and process preferences. Developers can choose how they interact with the tooling and teams can decide how deployments are executed.
Within each approach there is additional flexibility in terms of which capabilities to enable, and whether these capabilities are used with Flyway Desktop or automated using the Flyway CLI. Which approach to adopt will depend on the specific value that is regarded as most important to a team or organization.
To begin understanding which approach will best fit your needs, categories of questions to examine include:
- Manual deployments vs automated deployment pipeline. Will deployments be orchestrated by an automated CI/release tool, or will they be applied manually? Do you also want to include drift detection, code analysis, dry runs and change reporting for finer control over your database deployments?
- Database object-level version control. Are development teams looking to treat database code like they do application code, which means the database inherits all the benefits of Version Control Systems? Do you also want a fully trackable version history of database changes right down to the object level for use in auditing?
- Auto-generation of migration scripts. Are developers seeking productivity and quality gains by automating the generation of migration scripts? Do you have differing levels of experience in your team between major DBMS (SQL Server, PostgreSQL, Oracle and MySQL) that would benefit from standardization and speed of generating migration scripts?
For ease of onboarding, it may be shrewd to adopt an incremental approach to your database DevOps journey, focusing on solving the primary business need and over time evolving this to derive increasing value from the Flyway solution. We are also happy to help with questions about moving from one approach to another. Contact us and we will be in touch.
Foundational migrations approach
Community-proven and simple to run with a migrations-first development model
License: Flyway Community / Flyway Teams / Flyway Enterprise This approach is built on foundational capabilities supported by 50+ DBMS (see Flyway Feature Summary for more information) |
If required, a schema model step can be included into the process to maintain an object level history in version control.
License: Flyway Teams / Flyway Enterprise The schema model is available for SQL Server, Oracle, PostgreSQL and MySQL. Please contact us for more detail on this workflow. |
Migrations-based approach with auto-generation of migration scripts
If teams wish to benefit from productivity and efficiency gains, auto-generation of migration scripts can be enabled.
License: Flyway Enterprise Works with: SQL Server, Oracle, PostgreSQL and MySQL (see Flyway Feature Summary for more information) |
For database development teams that seek to improve collaboration and have greater control over when changes should be reflected in migration scripts, a schema model can be configured to be the source for the generation of migration scripts.
License: Flyway Enterprise |
Visit the Migrations-based approach with auto-generation of migration scripts page for more detail.
State-based approach
In a state-based deployment model the deployment script is generated at deployment time using comparison technology to compare the source state (eg. Development) with the target database (eg. Production). In this model developers do not have to author or test their own migration scripts, which provides for a very simple low-overhead process for development teams, but relies on the database comparison technology to generate the right deployment script. Therefore, it is well suited to database projects in which the changes can be easily inferred, like modifying code objects (programmable objects), changing data types, or adding new tables and columns, but is less well suited where human insight and intervention is necessary, for example adding a new NOT NULL column, or any changes that require data migration or manipulation.
License: Flyway Teams / Flyway Enterprise |
Teams employing DevOps processes such as continuous integration and continuous delivery can configure state-based deployments within their automated pipeline.
License: Flyway Enterprise |