Your SlideShare is downloading. ×
Flyway: The agile database migration framework for Java
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Flyway: The agile database migration framework for Java

3,261
views

Published on

Published in: Technology

2 Comments
5 Likes
Statistics
Notes
  • @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.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • I work with Flyway for 1 year and I must say this presentation is misty and unclear
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total Views
3,261
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
2
Likes
5
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • Plain Old SQLConvention Over ConfigurationFail fastZero-required dependenciesJava 5+ and JDBC driverDeceivingly simple, yet surprisingly powerful
  • Transcript

    • 1. The agile database migration framework for Java @axelfontaineAxel Fontaine axelfontaine.comSoftware Development Expert business@axelfontaine.com
    • 2. THE PLAN
    • 3. WARNING!Disruptive thinkingahead!
    • 4. The Problem
    • 5. addAgeToAccount.sql
    • 6. ?? DB
    • 7. DEV PROD ? http://digitalcitizen.ca/2009/06/22/simpsons-profile-pics-for-facebook-and-other-applications/
    • 8. VSDML DDL
    • 9. Problems for the DBA • Little understanding of context • Coordination with app deployer • Monkey work • Poor use of expertise • Poor working hours
    • 10. 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
    • 11. 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
    • 12. flywaydb.org
    • 13. 6 commandsclean info migrate validate init repair
    • 14. Empty DB Version 1 Version 2
    • 15. Flyway flyway = new Flyway();flyway.setDataSource(myDataSource);flyway.migrate();
    • 16. Demo
    • 17. DEV Migrate PROD on Startup
    • 18. Existing Production Database align DEV TEST PROD V1__Dump.sql
    • 19. Existing Production Database align DEV TEST PROD V1__Dump.sql
    • 20. Existing Production Database align DEV TEST PROD migrate V1__Dump.sql
    • 21. Existing Production Database align DEV TEST PROD migrate V1__Dump.sql
    • 22. 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(); } }}
    • 23. Multiple Locations http://www.flickr.com/photos/nrivera/3158808122/
    • 24. Backwards CompatibleMigrations
    • 25. DB Backup
    • 26. DB Backup
    • 27. DB
    • 28. DB
    • 29. DB
    • 30. ExampleRename column Surname -> Last_Name
    • 31. Surname Last_Name Surname ALTER TABLE … RENAME COLUMN
    • 32. 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 …
    • 33. Last_NameLast_Name DROP TRIGGER … ALTER TABLE … DROP COLUMN Surname
    • 34. Roadmap 2.1 2.2 3.0
    • 35. 1 day course Effective DatabaseMigrations with Flywayflywaydb.org/support/training.html
    • 36. flywaydb.org
    • 37. @axelfontaineAxel Fontaine axelfontaine.comSoftware Development Expert business@axelfontaine.com

    ×