SlideShare a Scribd company logo
1 of 55
Axel Fontaine

        FLYWAY
THE AGILE DATABASE MIGRATION
    FRAMEWORK FOR JAVA
Axel Fontaine                               @axelfontaine
                                         axelfontaine.com
Software Development Expert
                                business@axelfontaine.com




                              • Independent consultant


                              • Located in Munich


                              • Founder of Flyway
about


questions
THE PLAN
addAgeToAccount.sql
?
?   DB
DEV                                                                                              PROD




                                               ?


      http://digitalcitizen.ca/2009/06/22/simpsons-profile-pics-for-facebook-and-other-applications/
Problems for the DBA


  • Little understanding of context
  • Coordination with app deployer
  • Monkey work
  • Poor use of expertise
  • Poor working hours
Problems for DEV


  • Late review of changes
  • Manual step with friction
  • Less likely to change DB structure
  • Code and DB diverge
  • Incompatible with Continuous Deployment
Goals
                               Goals
• Cooperation between DEV and DBA
• Use full power of the DB
• (Almost) no lock-in
• Automatic so you can forget about it
• Descent working hours for everyone
flywaydb.org
3
years old
25 000
downloads in 2012
Keeping it simple
    (saying no)
6
               commands

clean   info    migrate   validate   init   repair
API

Classpath
                                Metadata    Database-
     +       Migration
                                  Table      specific
Filesystem   Execution
                               Management    support
scanning
Flyway flyway = new Flyway();
flyway.setDataSource(myDataSource);
flyway.migrate();


mvn flyway:migrate


<flyway:migrate />


flyway.cmd migrate
Empty DB
Empty DB   Version 1
Empty DB   Version 1   Version 2
And what about
  the DBA?
VS
DML        DDL
DEV
      Migrate   PROD
        on
      Startup
Demo
When sql isn’t
 enough…
Java Migrations

public class V1_2__Another_user implements JdbcMigration {

    public void migrate(Connection conn) throws Exception {

        try (PreparedStatement stmt = conn.prepareStatement(“…")) {
          stmt.execute();
        }
    }
}
When greenfield
isn’t an option…
Existing Production Database



                                align



             DEV         TEST           PROD




         V1__Dump.sql
Existing Production Database



                                align



             DEV         TEST           PROD




         V1__Dump.sql
Existing Production Database



                                align



                 DEV     TEST           PROD



       migrate




         V1__Dump.sql
Existing Production Database



                                align



                 DEV     TEST           PROD



       migrate




         V1__Dump.sql
Existing Production Database



                                          align



                 DEV         TEST                 PROD



       migrate




         V1__Dump.sql   V2__Changes.sql
Existing Production Database




           DEV             TEST         PROD




                      V2__Changes.sql
Existing Production Database




           DEV              TEST        PROD


                      migrate




                      V2__Changes.sql
Existing Production Database




           DEV             TEST         PROD




                      V2__Changes.sql
Backwards-
compatible migrations
Example

Rename column
 Surname -> Last_Name
Surname             Last_Name



          Surname




                ALTER TABLE … RENAME COLUMN
Last_Name                       Last_Name



Surname                       Last_Name




          ALTER TABLE …                  DROP TRIGGER …
            ADD COLUMN Last_Name         ALTER TABLE …
          UPDATE … SET Last_Name = Surname DROP COLUMN Surname
          CREATE TRIGGER …
Last_Name



Last_Name




        DROP TRIGGER …
        ALTER TABLE …
          DROP COLUMN Surname
Roadmap




   2.2       2.3       3.0

 Q2 2013   Q3 2013   Q4 2013
flywaydb.org
1 day course


 Effective Database
Migrations with Flyway




flywaydb.org/support/training.html
@axelfontaine
Axel Fontaine                          axelfontaine.com
Software Development Expert   business@axelfontaine.com

More Related Content

What's hot

What's hot (20)

Liquibase & Flyway @ Baltic DevOps
Liquibase & Flyway @ Baltic DevOpsLiquibase & Flyway @ Baltic DevOps
Liquibase & Flyway @ Baltic DevOps
 
Flywaydb
FlywaydbFlywaydb
Flywaydb
 
LiquiBase
LiquiBaseLiquiBase
LiquiBase
 
Database Change Management as a Service
Database Change Management as a ServiceDatabase Change Management as a Service
Database Change Management as a Service
 
Database Migrations with Gradle and Liquibase
Database Migrations with Gradle and LiquibaseDatabase Migrations with Gradle and Liquibase
Database Migrations with Gradle and Liquibase
 
Agile Database Development with Liquibase
Agile Database Development with LiquibaseAgile Database Development with Liquibase
Agile Database Development with Liquibase
 
Liquibase for java developers
Liquibase for java developersLiquibase for java developers
Liquibase for java developers
 
Faster java ee builds with gradle [con4921]
Faster java ee builds with gradle [con4921]Faster java ee builds with gradle [con4921]
Faster java ee builds with gradle [con4921]
 
Introduction to Play Framework
Introduction to Play FrameworkIntroduction to Play Framework
Introduction to Play Framework
 
Database versioning with liquibase
Database versioning with liquibaseDatabase versioning with liquibase
Database versioning with liquibase
 
Evolutionary Database Design
Evolutionary Database DesignEvolutionary Database Design
Evolutionary Database Design
 
OpenNTF Webinar May 2021 - Jesse
OpenNTF Webinar May 2021 - JesseOpenNTF Webinar May 2021 - Jesse
OpenNTF Webinar May 2021 - Jesse
 
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
 
CollabSphere 2020 - NSF ODP Tooling
CollabSphere 2020 - NSF ODP ToolingCollabSphere 2020 - NSF ODP Tooling
CollabSphere 2020 - NSF ODP Tooling
 
Apache DeltaSpike the CDI toolbox
Apache DeltaSpike the CDI toolboxApache DeltaSpike the CDI toolbox
Apache DeltaSpike the CDI toolbox
 
In The Trenches With Tomster, Upgrading Ember.js & Ember Data
In The Trenches With Tomster, Upgrading Ember.js & Ember DataIn The Trenches With Tomster, Upgrading Ember.js & Ember Data
In The Trenches With Tomster, Upgrading Ember.js & Ember Data
 
Handling Database Deployments
Handling Database DeploymentsHandling Database Deployments
Handling Database Deployments
 
Why jakarta ee matters (ConFoo 2021)
Why jakarta ee matters (ConFoo 2021)Why jakarta ee matters (ConFoo 2021)
Why jakarta ee matters (ConFoo 2021)
 
OpenNTF Domino API (ODA): Super-Charging Domino Development
OpenNTF Domino API (ODA): Super-Charging Domino DevelopmentOpenNTF Domino API (ODA): Super-Charging Domino Development
OpenNTF Domino API (ODA): Super-Charging Domino Development
 
Node.js Development with Apache NetBeans
Node.js Development with Apache NetBeansNode.js Development with Apache NetBeans
Node.js Development with Apache NetBeans
 

Viewers also liked

Viewers also liked (20)

Javaland 2016 - Flyway vs. LiquiBase - Battle der Datenbankmigrationstools
Javaland 2016 - Flyway vs. LiquiBase - Battle der DatenbankmigrationstoolsJavaland 2016 - Flyway vs. LiquiBase - Battle der Datenbankmigrationstools
Javaland 2016 - Flyway vs. LiquiBase - Battle der Datenbankmigrationstools
 
Continuous Delivery and Zero Downtime: What your architecture needs to succeed
Continuous Delivery and Zero Downtime: What your architecture needs to succeedContinuous Delivery and Zero Downtime: What your architecture needs to succeed
Continuous Delivery and Zero Downtime: What your architecture needs to succeed
 
Architecting for continuous delivery (33rd Degree)
Architecting for continuous delivery (33rd Degree)Architecting for continuous delivery (33rd Degree)
Architecting for continuous delivery (33rd Degree)
 
33rd degree talk: open and automatic coding conventions with walkmod
33rd degree talk: open and automatic coding conventions with walkmod33rd degree talk: open and automatic coding conventions with walkmod
33rd degree talk: open and automatic coding conventions with walkmod
 
The Challenges & Pitfalls of Database Continuous Delivery
The Challenges & Pitfalls of Database Continuous DeliveryThe Challenges & Pitfalls of Database Continuous Delivery
The Challenges & Pitfalls of Database Continuous Delivery
 
Challenges and best practices of database continuous delivery
Challenges and best practices of database continuous deliveryChallenges and best practices of database continuous delivery
Challenges and best practices of database continuous delivery
 
walkmod: how it works
walkmod: how it workswalkmod: how it works
walkmod: how it works
 
Patterns and Tools for Database Versioning, Migration, Data Loading and Test ...
Patterns and Tools for Database Versioning, Migration, Data Loading and Test ...Patterns and Tools for Database Versioning, Migration, Data Loading and Test ...
Patterns and Tools for Database Versioning, Migration, Data Loading and Test ...
 
Road to database automation: database source control
Road to database automation: database source controlRoad to database automation: database source control
Road to database automation: database source control
 
Database version control without pain - the PHPNW10 version
Database version control without pain - the PHPNW10 versionDatabase version control without pain - the PHPNW10 version
Database version control without pain - the PHPNW10 version
 
Database Source Control: Migrations vs State
Database Source Control: Migrations vs StateDatabase Source Control: Migrations vs State
Database Source Control: Migrations vs State
 
Rest api standards and best practices
Rest api standards and best practicesRest api standards and best practices
Rest api standards and best practices
 
Liquibase – a time machine for your data
Liquibase – a time machine for your dataLiquibase – a time machine for your data
Liquibase – a time machine for your data
 
Liquibase migration for data bases
Liquibase migration for data basesLiquibase migration for data bases
Liquibase migration for data bases
 
KYSUC - Keep Your Schema Under Control
KYSUC - Keep Your Schema Under ControlKYSUC - Keep Your Schema Under Control
KYSUC - Keep Your Schema Under Control
 
SpringBoot with MyBatis, Flyway, QueryDSL
SpringBoot with MyBatis, Flyway, QueryDSLSpringBoot with MyBatis, Flyway, QueryDSL
SpringBoot with MyBatis, Flyway, QueryDSL
 
RESTful API
RESTful APIRESTful API
RESTful API
 
MyBatis
MyBatisMyBatis
MyBatis
 
Database Schema Evolution
Database Schema EvolutionDatabase Schema Evolution
Database Schema Evolution
 
Database security issues
Database security issuesDatabase security issues
Database security issues
 

Similar to Flyway (33rd Degree)

Jmorrow rtv den_auto_config_rapidclone
Jmorrow rtv den_auto_config_rapidcloneJmorrow rtv den_auto_config_rapidclone
Jmorrow rtv den_auto_config_rapidclone
Mlx Le
 
Борис Трофимов. Continuous Database migration-это просто!
Борис Трофимов. Continuous Database migration-это просто!Борис Трофимов. Continuous Database migration-это просто!
Борис Трофимов. Continuous Database migration-это просто!
Volha Banadyseva
 

Similar to Flyway (33rd Degree) (20)

Javaone 2014
Javaone 2014Javaone 2014
Javaone 2014
 
Migrating Legacy Data (Ruby Midwest)
Migrating Legacy Data (Ruby Midwest)Migrating Legacy Data (Ruby Midwest)
Migrating Legacy Data (Ruby Midwest)
 
Offline Html5 3days
Offline Html5 3daysOffline Html5 3days
Offline Html5 3days
 
Obevo Javasig.pptx
Obevo Javasig.pptxObevo Javasig.pptx
Obevo Javasig.pptx
 
Database deployments - dotnetsheff
Database deployments - dotnetsheffDatabase deployments - dotnetsheff
Database deployments - dotnetsheff
 
Enterprise db-change-management&amp;deployment-demo
Enterprise db-change-management&amp;deployment-demoEnterprise db-change-management&amp;deployment-demo
Enterprise db-change-management&amp;deployment-demo
 
DevOps Drive-In: Automate Database Deployments in Your Continuous Delivery Pi...
DevOps Drive-In: Automate Database Deployments in Your Continuous Delivery Pi...DevOps Drive-In: Automate Database Deployments in Your Continuous Delivery Pi...
DevOps Drive-In: Automate Database Deployments in Your Continuous Delivery Pi...
 
Developing Kafka Streams Applications with Upgradability in Mind with Neil Bu...
Developing Kafka Streams Applications with Upgradability in Mind with Neil Bu...Developing Kafka Streams Applications with Upgradability in Mind with Neil Bu...
Developing Kafka Streams Applications with Upgradability in Mind with Neil Bu...
 
Database CI/CD Pipeline
Database CI/CD PipelineDatabase CI/CD Pipeline
Database CI/CD Pipeline
 
Liquibase - Open Source version control for your database
Liquibase - Open Source version control for your databaseLiquibase - Open Source version control for your database
Liquibase - Open Source version control for your database
 
Data Virtualization: Revolutionizing data cloning
Data Virtualization: Revolutionizing data cloningData Virtualization: Revolutionizing data cloning
Data Virtualization: Revolutionizing data cloning
 
Grails Plugin Best Practices
Grails Plugin Best PracticesGrails Plugin Best Practices
Grails Plugin Best Practices
 
Db trends final
Db trends   finalDb trends   final
Db trends final
 
Jmorrow rtv den_auto_config_rapidclone
Jmorrow rtv den_auto_config_rapidcloneJmorrow rtv den_auto_config_rapidclone
Jmorrow rtv den_auto_config_rapidclone
 
Training: Day Two - Eclipse, Git, Maven
Training: Day Two - Eclipse, Git, MavenTraining: Day Two - Eclipse, Git, Maven
Training: Day Two - Eclipse, Git, Maven
 
XFILES, the APEX 4 version - The truth is in there
XFILES, the APEX 4 version - The truth is in thereXFILES, the APEX 4 version - The truth is in there
XFILES, the APEX 4 version - The truth is in there
 
Drupal & Continous Integration - SF State Study Case
Drupal & Continous Integration - SF State Study CaseDrupal & Continous Integration - SF State Study Case
Drupal & Continous Integration - SF State Study Case
 
Cloud Computing: Powering the Future of Development and Testing
Cloud Computing: Powering the Future of Development and TestingCloud Computing: Powering the Future of Development and Testing
Cloud Computing: Powering the Future of Development and Testing
 
Continuous DB migration based on carbon5 framework
Continuous DB migration based on carbon5 frameworkContinuous DB migration based on carbon5 framework
Continuous DB migration based on carbon5 framework
 
Борис Трофимов. Continuous Database migration-это просто!
Борис Трофимов. Continuous Database migration-это просто!Борис Трофимов. Continuous Database migration-это просто!
Борис Трофимов. Continuous Database migration-это просто!
 

More from Axel Fontaine

Architecting for Continuous Delivery
Architecting for Continuous DeliveryArchitecting for Continuous Delivery
Architecting for Continuous Delivery
Axel Fontaine
 

More from Axel Fontaine (7)

Immutable Infrastructure: the new App Deployment
Immutable Infrastructure: the new App DeploymentImmutable Infrastructure: the new App Deployment
Immutable Infrastructure: the new App Deployment
 
Jfokus 2015 - Immutable Server generation: the new App Deployment
Jfokus 2015 - Immutable Server generation: the new App DeploymentJfokus 2015 - Immutable Server generation: the new App Deployment
Jfokus 2015 - Immutable Server generation: the new App Deployment
 
Immutable Server generation: The new App Deployment
Immutable Server generation: The new App DeploymentImmutable Server generation: The new App Deployment
Immutable Server generation: The new App Deployment
 
Continuous Delivery and Zero Downtime
Continuous Delivery and Zero DowntimeContinuous Delivery and Zero Downtime
Continuous Delivery and Zero Downtime
 
XP Days Ukraine 2013 - Architecting for Continuous Delivery
XP Days Ukraine 2013 - Architecting for Continuous DeliveryXP Days Ukraine 2013 - Architecting for Continuous Delivery
XP Days Ukraine 2013 - Architecting for Continuous Delivery
 
Architecting for Continuous Delivery
Architecting for Continuous DeliveryArchitecting for Continuous Delivery
Architecting for Continuous Delivery
 
Continuous Delivery
Continuous DeliveryContinuous Delivery
Continuous Delivery
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Choreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software EngineeringChoreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software Engineering
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptx
 
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Navigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern EnterpriseNavigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern Enterprise
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate Guide
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Modernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaModernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using Ballerina
 

Flyway (33rd Degree)

Editor's Notes

  1. Plain Old SQLConvention Over ConfigurationFail fastZero-required dependenciesJava 5+ and JDBC driverDeceivingly simple, yet surprisingly powerful