Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Database migrations
Flyway and Liquibase
Lars Östling
lars.ostling@jayway.com
@larsostling
Agenda
• Database migrations
• Flyway
• Liquibase
• Conclusions
Back in the day…
• Big up-front design
• Long development cycles
• Scary updates
In an agile world…
• Short iterations
• Continuous integration /
delivery / deployment
• Delivery pipe-lines
• We do it fo...
The challenge
• Frequent database updates
• Managing multiple sql files
• What has been applied and
what has not?
• Keeping...
The solution
Automated database migrations:
• Recreate database from
scratch
• Make it clear at all times what
state a dat...
What is Flyway?
• Agile database migration framework for Java
• Open Source Apache 2.0 license
• Started in 2010
• Status ...
Demo
https://github.com/larsostling/
database-migrations-demo
Short recap
• Schema version table
• Convention over configuration
• Sql and java migrations
• Supereasy to setup
What is Liquibase?
• Agile database migration framework for Java
• Open Source Apache 2.0 license
• Started in 2006
• http...
Demo
https://github.com/larsostling/
database-migrations-demo
Short recap
• Uses structured DSL to
describe database changes
• Databasechangelog table
• Supports rollback
• generateCha...
Flyway vs. Liquibase
• SQL vs. XML
• Multiple files vs. single file
• No rollback vs. rollback
• KISS vs. less KISS
Some advice
• Migrate on application startup
• Change sets do not change
• People and processes
Lessons learned
• Stop worrying about database
changes
• Pick a framework and start
using it
Q & A
Thanks!
Lars Östling
lars.ostling@jayway.com
@larsostling
Database migrations with Flyway and Liquibase
Database migrations with Flyway and Liquibase
Database migrations with Flyway and Liquibase
Upcoming SlideShare
Loading in …5
×

Database migrations with Flyway and Liquibase

7,255 views

Published on

An agile world of continuous integration and deployment reinforces the need to be able to seamlessly and effortlessly update your database to keep it in sync with the latest changes in your code. Implementing database migrations with Flyway or Liquibase will help you do just that. This presentation gives a quick overview of the two frameworks accompanied by some simple demos.

Published in: Software
  • Dating for everyone is here: ♥♥♥ http://bit.ly/2F7hN3u ♥♥♥
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Dating direct: ♥♥♥ http://bit.ly/2F7hN3u ♥♥♥
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Database migrations with Flyway and Liquibase

  1. 1. Database migrations Flyway and Liquibase Lars Östling lars.ostling@jayway.com @larsostling
  2. 2. Agenda • Database migrations • Flyway • Liquibase • Conclusions
  3. 3. Back in the day… • Big up-front design • Long development cycles • Scary updates
  4. 4. In an agile world… • Short iterations • Continuous integration / delivery / deployment • Delivery pipe-lines • We do it for code … • … what about the database?
  5. 5. The challenge • Frequent database updates • Managing multiple sql files • What has been applied and what has not? • Keeping code and database in sync … • … throughout all environments
  6. 6. The solution Automated database migrations: • Recreate database from scratch • Make it clear at all times what state a database is in • Migrate in a deterministic way from current version of the database to a newer one
  7. 7. What is Flyway? • Agile database migration framework for Java • Open Source Apache 2.0 license • Started in 2010 • Status ‘Adopt’ on thoughtworks technology radar • http://www.flywaydb.org
  8. 8. Demo https://github.com/larsostling/ database-migrations-demo
  9. 9. Short recap • Schema version table • Convention over configuration • Sql and java migrations • Supereasy to setup
  10. 10. What is Liquibase? • Agile database migration framework for Java • Open Source Apache 2.0 license • Started in 2006 • http://www.liquibase.org
  11. 11. Demo https://github.com/larsostling/ database-migrations-demo
  12. 12. Short recap • Uses structured DSL to describe database changes • Databasechangelog table • Supports rollback • generateChangeLog
  13. 13. Flyway vs. Liquibase • SQL vs. XML • Multiple files vs. single file • No rollback vs. rollback • KISS vs. less KISS
  14. 14. Some advice • Migrate on application startup • Change sets do not change • People and processes
  15. 15. Lessons learned • Stop worrying about database changes • Pick a framework and start using it
  16. 16. Q & A
  17. 17. Thanks! Lars Östling lars.ostling@jayway.com @larsostling

×