Your SlideShare is downloading. ×

Flyway (33rd Degree)

10,278

Published on

My talk from the 33rd Degree conference 2013 in Warsaw

My talk from the 33rd Degree conference 2013 in Warsaw

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
10,278
On Slideshare
0
From Embeds
0
Number of Embeds
18
Actions
Shares
0
Downloads
0
Comments
0
Likes
1
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. Axel Fontaine FLYWAYTHE AGILE DATABASE MIGRATION FRAMEWORK FOR JAVA
    • 2. Axel Fontaine @axelfontaine axelfontaine.comSoftware Development Expert business@axelfontaine.com • Independent consultant • Located in Munich • Founder of Flyway
    • 3. aboutquestions
    • 4. THE PLAN
    • 5. addAgeToAccount.sql
    • 6. ?? DB
    • 7. DEV PROD ? http://digitalcitizen.ca/2009/06/22/simpsons-profile-pics-for-facebook-and-other-applications/
    • 8. Problems for the DBA • Little understanding of context • Coordination with app deployer • Monkey work • Poor use of expertise • Poor working hours
    • 9. 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
    • 10. 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
    • 11. flywaydb.org
    • 12. 3years old
    • 13. 25 000downloads in 2012
    • 14. Keeping it simple (saying no)
    • 15. 6 commandsclean info migrate validate init repair
    • 16. APIClasspath Metadata Database- + Migration Table specificFilesystem Execution Management supportscanning
    • 17. Flyway flyway = new Flyway();flyway.setDataSource(myDataSource);flyway.migrate();mvn flyway:migrate<flyway:migrate />flyway.cmd migrate
    • 18. Empty DB
    • 19. Empty DB Version 1
    • 20. Empty DB Version 1 Version 2
    • 21. And what about the DBA?
    • 22. VSDML DDL
    • 23. DEV Migrate PROD on Startup
    • 24. Demo
    • 25. When sql isn’t enough…
    • 26. Java Migrationspublic class V1_2__Another_user implements JdbcMigration { public void migrate(Connection conn) throws Exception { try (PreparedStatement stmt = conn.prepareStatement(“…")) { stmt.execute(); } }}
    • 27. When greenfieldisn’t an option…
    • 28. Existing Production Database align DEV TEST PROD V1__Dump.sql
    • 29. Existing Production Database align DEV TEST PROD V1__Dump.sql
    • 30. Existing Production Database align DEV TEST PROD migrate V1__Dump.sql
    • 31. Existing Production Database align DEV TEST PROD migrate V1__Dump.sql
    • 32. Existing Production Database align DEV TEST PROD migrate V1__Dump.sql V2__Changes.sql
    • 33. Existing Production Database DEV TEST PROD V2__Changes.sql
    • 34. Existing Production Database DEV TEST PROD migrate V2__Changes.sql
    • 35. Existing Production Database DEV TEST PROD V2__Changes.sql
    • 36. Backwards-compatible migrations
    • 37. ExampleRename column Surname -> Last_Name
    • 38. Surname Last_Name Surname ALTER TABLE … RENAME COLUMN
    • 39. 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 …
    • 40. Last_NameLast_Name DROP TRIGGER … ALTER TABLE … DROP COLUMN Surname
    • 41. Roadmap 2.2 2.3 3.0 Q2 2013 Q3 2013 Q4 2013
    • 42. flywaydb.org
    • 43. 1 day course Effective DatabaseMigrations with Flywayflywaydb.org/support/training.html
    • 44. @axelfontaineAxel Fontaine axelfontaine.comSoftware Development Expert business@axelfontaine.com

    ×