• Save
Flyway: The agile database migration framework for Java
Upcoming SlideShare
Loading in...5
×
 

Flyway: The agile database migration framework for Java

on

  • 3,467 views

 

Statistics

Views

Total Views
3,467
Views on SlideShare
3,291
Embed Views
176

Actions

Likes
3
Downloads
0
Comments
2

2 Embeds 176

http://axelfontaine.com 105
http://localhost 71

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel

12 of 2

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
  • @alexnenko As you no doubt have guessed, my slides are there to support my talk. Not the other way around. They therefore have limited use by themselves. Having them online primarily serves as a memory aid for the ones who attended the presentation.
    Are you sure you want to
    Your message goes here
    Processing…
  • I work with Flyway for 1 year and I must say this presentation is misty and unclear
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • Plain Old SQLConvention Over ConfigurationFail fastZero-required dependenciesJava 5+ and JDBC driverDeceivingly simple, yet surprisingly powerful

Flyway: The agile database migration framework for Java Flyway: The agile database migration framework for Java Presentation Transcript

  • The agile database migration framework for Java @axelfontaineAxel Fontaine axelfontaine.comSoftware Development Expert business@axelfontaine.com
  • THE PLAN
  • WARNING!Disruptive thinkingahead!
  • The Problem
  • addAgeToAccount.sql
  • ?? DB
  • DEV PROD ? http://digitalcitizen.ca/2009/06/22/simpsons-profile-pics-for-facebook-and-other-applications/
  • VSDML DDL
  • 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• Integrate in app so you can forget about it• Descent working hours for everyone
  • flywaydb.org
  • 6 commandsclean info migrate validate init repair
  • Empty DB Version 1 Version 2
  • Flyway flyway = new Flyway();flyway.setDataSource(myDataSource);flyway.migrate();
  • Demo
  • DEV Migrate PROD on Startup
  • 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
  • Java Migrationspublic class V1_2__Another_user implements JdbcMigration { public void migrate(Connection conn) throws Exception { PreparedStatement stmt = conn.prepareStatement(“…"); try { stmt.execute(); } finally { stmt.close(); } }}
  • Multiple Locations http://www.flickr.com/photos/nrivera/3158808122/
  • Backwards CompatibleMigrations
  • DB Backup
  • DB Backup
  • DB
  • DB
  • DB
  • ExampleRename column Surname -> Last_Name
  • Surname Last_Name Surname ALTER TABLE … RENAME COLUMN
  • Last_Name Last_NameSurname Last_Name ALTER TABLE … DROP TRIGGER … ADD COLUMN Last_Name ALTER TABLE … UPDATE … SET Last_Name = Surname DROP COLUMN Surname CREATE TRIGGER …
  • Last_NameLast_Name DROP TRIGGER … ALTER TABLE … DROP COLUMN Surname
  • Roadmap 2.1 2.2 3.0
  • 1 day course Effective DatabaseMigrations with Flywayflywaydb.org/support/training.html
  • flywaydb.org
  • @axelfontaineAxel Fontaine axelfontaine.comSoftware Development Expert business@axelfontaine.com