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.
Continuous DB Changes Delivery
With Liquibase
Presented by Aidas Dragunas
Agenda
• The short overview of Continuous Delivery process
• The overview of Liquibase technology as one of open source
te...
Continuous Delivery Overview
How to continuously deliver application changes to the
testing and production environment
Deployment automation stages
Commit Code
Perform Unit &
Integration
testing
Deploy to
testing
environment
Perform
Acceptan...
Continuous integration process
3
2
4
CI Server
(Jenkins)
Development team
SCM repository
(GIT, SVN)
1
Notification
Binary ...
Continuous delivery process
2
5
4
3
CI Server
(Jenkins)
Testing
Environment
Development team
SCM repository
(GIT, SVN)
1
N...
Continuous deployment
process
2
4
5
3
7
6
CI Server
(Jenkins)
Testing
Environment
Development team
SCM repository
(GIT, SV...
Continuous delivery key notes
• DB changes and web changes are committed into the SCM
repository together
• DB changes are...
Liquibase Overview
Overview of Liquibase - one of DB changes deployment tools
Introduction
• Purpose
• Provide structure to track and
manage DB changes
• Deploy DB changes to the
database
• Main keywo...
Features
• Changeset descripton formats
• XML
• SQL
• JSON
• YAML
• Changeset description types
• Inside Changelog file
• ...
Benefits
• Flexible
• Plugins for main deployment engines (Ant, Maven, Gradle)
• Suitable for beginners and for experience...
Drawbacks
• Sometimes too complex, especially for datasets deployment
• Manually defining the order of changes
• Different...
Liquibase vs Flyway
Feature Liquibase Flyway
Incremental migration x x
Migration SQL preview x
Migration formats XML, SQL,...
Documentation
• http://www.liquibase.org/documentation/index.html
• http://www.datical.com/wp-content/uploads/2013/09/3-
T...
Continuous Delivery With Liquibase
Demo
How to continuously deliver DB changes to the PostgreSQL
database using Liquibase
Solutions Pie
PostgreSQL
Jenkins/Nexus
Git
Maven/Ant/Gradle
Liquibase
(Changelogs/Changesets)
Changelogs catalog structure
• changes
• change-20151009142310
• change.sql
• change.xml
• change-20151009143745
• ....
• ...
Live Example
Questions?
Upcoming SlideShare
Loading in …5
×

Continuous DB Changes Delivery With Liquibase

3,898 views

Published on

The short overview of Continuous Delivery process. The overview of Liquibase technology as one of open source technologies, designed for DB changes migration. Live demonstration of how Liquibase could be used in Continuous Delivery process.

Published in: Software
  • Be the first to comment

Continuous DB Changes Delivery With Liquibase

  1. 1. Continuous DB Changes Delivery With Liquibase Presented by Aidas Dragunas
  2. 2. Agenda • The short overview of Continuous Delivery process • The overview of Liquibase technology as one of open source technologies, designed for DB changes migration • Live demonstration of how Liquibase could be used in Continuous Delivery process
  3. 3. Continuous Delivery Overview How to continuously deliver application changes to the testing and production environment
  4. 4. Deployment automation stages Commit Code Perform Unit & Integration testing Deploy to testing environment Perform Acceptance testing Deploy to production environment Continuous Integration Continuous Delivery Continuous Deployment
  5. 5. Continuous integration process 3 2 4 CI Server (Jenkins) Development team SCM repository (GIT, SVN) 1 Notification Binary repository (Nexus)
  6. 6. Continuous delivery process 2 5 4 3 CI Server (Jenkins) Testing Environment Development team SCM repository (GIT, SVN) 1 Notification Binary repository (Nexus)
  7. 7. Continuous deployment process 2 4 5 3 7 6 CI Server (Jenkins) Testing Environment Development team SCM repository (GIT, SVN) 1 Stakeholders Production Environment Notification Notification Binary repository (Nexus)
  8. 8. Continuous delivery key notes • DB changes and web changes are committed into the SCM repository together • DB changes are created and stored incrementally • DB changes are deployed incrementally • DB changes and web changes are deployed together
  9. 9. Liquibase Overview Overview of Liquibase - one of DB changes deployment tools
  10. 10. Introduction • Purpose • Provide structure to track and manage DB changes • Deploy DB changes to the database • Main keywords • Master Changelog • Incremental Changelog • Changeset • Latest version • 3.4.2 (November 24, 2015) • License • Liquibase - Apache 2.0 • Datical DB - Commerce version of Liquibase • Principles • Manage DB changes in small chunks – Changesets • Store DB changes in Changelog files (preferably one Changeset in one file). • Use Changelog tables in the DB to track and manage DB changes deployment process.
  11. 11. Features • Changeset descripton formats • XML • SQL • JSON • YAML • Changeset description types • Inside Changelog file • Outside Changelog file • Changeset types • DB structure changes • Methods • Data changes • Database types • Oracle • PostgreSQL • SQL Server • MySQL • Other • Additional features • DB changes file generation • DB changes rollback • DB difference generation • DB documentation • Plugins • Ant, Maven, Gradle (third party provider) • Spring
  12. 12. Benefits • Flexible • Plugins for main deployment engines (Ant, Maven, Gradle) • Suitable for beginners and for experienced developers • Abiliy to load data and compile methods • Ability to rollback changes • Ability to review changes SQL file • Ability to generate documentation • Manually defining the order of changes • Supports various changelog formats • Supports the majority of database vendors
  13. 13. Drawbacks • Sometimes too complex, especially for datasets deployment • Manually defining the order of changes • Different plugins features for Gradle, Maven and Ant • Poorly formated output log • Change locks happen. When manual lock release should be performed directly in the database • Limited by JDBC • Doesn‘t support Slonik files, so PostgreSQL built-in streaming replication should be enabled
  14. 14. Liquibase vs Flyway Feature Liquibase Flyway Incremental migration x x Migration SQL preview x Migration formats XML, SQL, YAML, JSON SQL, Java Migration order management strategy Manual Automatic Migration rollback x Repeated change execution x Context based change deployment x
  15. 15. Documentation • http://www.liquibase.org/documentation/index.html • http://www.datical.com/wp-content/uploads/2013/09/3- Technical-Brief-Datical-DB.pdf
  16. 16. Continuous Delivery With Liquibase Demo How to continuously deliver DB changes to the PostgreSQL database using Liquibase
  17. 17. Solutions Pie PostgreSQL Jenkins/Nexus Git Maven/Ant/Gradle Liquibase (Changelogs/Changesets)
  18. 18. Changelogs catalog structure • changes • change-20151009142310 • change.sql • change.xml • change-20151009143745 • .... • changelog.xml • datasets • dataset-0001 • dataset.xml • dataset-0002 • .... • changelog.xml • methods • changelog.xml • env • local.properties • development.properties • qa.properties • production.properties • gradle • libs
  19. 19. Live Example
  20. 20. Questions?

×