• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Flyway (33rd Degree)
 

Flyway (33rd Degree)

on

  • 4,785 views

My talk from the 33rd Degree conference 2013 in Warsaw

My talk from the 33rd Degree conference 2013 in Warsaw

Statistics

Views

Total Views
4,785
Views on SlideShare
887
Embed Views
3,898

Actions

Likes
1
Downloads
0
Comments
0

11 Embeds 3,898

http://axelfontaine.com 3602
http://localhost 244
https://twitter.com 36
https://www.google.se 5
http://translate.googleusercontent.com 3
https://www.google.de 2
http://www.google.com 2
http://www.google.pl 1
http://www.betriebsrat.bankaustria.at&_=1400137457127 HTTP 1
http://siguniang.wordpress.com 1
http://prlog.ru 1
More...

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
  • Full Name Full Name Comment goes here.
    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 (33rd Degree) Flyway (33rd Degree) Presentation Transcript

  • Axel Fontaine FLYWAYTHE AGILE DATABASE MIGRATION FRAMEWORK FOR JAVA
  • Axel Fontaine @axelfontaine axelfontaine.comSoftware Development Expert business@axelfontaine.com • Independent consultant • Located in Munich • Founder of Flyway
  • aboutquestions
  • 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
  • 3years old
  • 25 000downloads in 2012
  • Keeping it simple (saying no)
  • 6 commandsclean info migrate validate init repair
  • APIClasspath Metadata Database- + Migration Table specificFilesystem Execution Management supportscanning
  • 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?
  • VSDML DDL
  • DEV Migrate PROD on Startup
  • Demo
  • When sql isn’t enough…
  • Java Migrationspublic class V1_2__Another_user implements JdbcMigration { public void migrate(Connection conn) throws Exception { try (PreparedStatement stmt = conn.prepareStatement(“…")) { stmt.execute(); } }}
  • When greenfieldisn’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
  • 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.2 2.3 3.0 Q2 2013 Q3 2013 Q4 2013
  • flywaydb.org
  • 1 day course Effective DatabaseMigrations with Flywayflywaydb.org/support/training.html
  • @axelfontaineAxel Fontaine axelfontaine.comSoftware Development Expert business@axelfontaine.com