continuous db changes delivery with liquibase
TRANSCRIPT
![Page 1: Continuous DB Changes Delivery With Liquibase](https://reader035.vdocuments.us/reader035/viewer/2022062316/587614fe1a28ab306c8b65eb/html5/thumbnails/1.jpg)
Continuous DB Changes Delivery With LiquibasePresented by Aidas Dragunas
![Page 2: Continuous DB Changes Delivery With Liquibase](https://reader035.vdocuments.us/reader035/viewer/2022062316/587614fe1a28ab306c8b65eb/html5/thumbnails/2.jpg)
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
![Page 3: Continuous DB Changes Delivery With Liquibase](https://reader035.vdocuments.us/reader035/viewer/2022062316/587614fe1a28ab306c8b65eb/html5/thumbnails/3.jpg)
Continuous Delivery Overview How to continuously deliver application changes to the testing and production environment
![Page 4: Continuous DB Changes Delivery With Liquibase](https://reader035.vdocuments.us/reader035/viewer/2022062316/587614fe1a28ab306c8b65eb/html5/thumbnails/4.jpg)
Deployment automation stages
Commit CodePerform Unit &
Integration testing
Deploy to testing
environment
Perform Acceptance
testing
Deploy to production
environment
Continuous Integration
Continuous Delivery
Continuous Deployment
![Page 5: Continuous DB Changes Delivery With Liquibase](https://reader035.vdocuments.us/reader035/viewer/2022062316/587614fe1a28ab306c8b65eb/html5/thumbnails/5.jpg)
Continuous integration process
3
2
4
CI Server (Jenkins)
Development teamSCM repository
(GIT, SVN)
1
Notification
Binary repository (Nexus)
![Page 6: Continuous DB Changes Delivery With Liquibase](https://reader035.vdocuments.us/reader035/viewer/2022062316/587614fe1a28ab306c8b65eb/html5/thumbnails/6.jpg)
Continuous delivery process
25
4
3
CI Server (Jenkins)
Testing Environment
Development teamSCM repository
(GIT, SVN)
1
Notification
Binary repository (Nexus)
![Page 7: Continuous DB Changes Delivery With Liquibase](https://reader035.vdocuments.us/reader035/viewer/2022062316/587614fe1a28ab306c8b65eb/html5/thumbnails/7.jpg)
Continuous deployment process
2
4
5
3
7
6
CI Server (Jenkins)
Testing Environment
Development teamSCM repository
(GIT, SVN)
1
Stakeholders
Production Environment
Notification
Notification
Binary repository (Nexus)
![Page 8: Continuous DB Changes Delivery With Liquibase](https://reader035.vdocuments.us/reader035/viewer/2022062316/587614fe1a28ab306c8b65eb/html5/thumbnails/8.jpg)
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
![Page 9: Continuous DB Changes Delivery With Liquibase](https://reader035.vdocuments.us/reader035/viewer/2022062316/587614fe1a28ab306c8b65eb/html5/thumbnails/9.jpg)
Liquibase OverviewOverview of Liquibase - one of DB changes deployment tools
![Page 10: Continuous DB Changes Delivery With Liquibase](https://reader035.vdocuments.us/reader035/viewer/2022062316/587614fe1a28ab306c8b65eb/html5/thumbnails/10.jpg)
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.
![Page 11: Continuous DB Changes Delivery With Liquibase](https://reader035.vdocuments.us/reader035/viewer/2022062316/587614fe1a28ab306c8b65eb/html5/thumbnails/11.jpg)
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
![Page 12: Continuous DB Changes Delivery With Liquibase](https://reader035.vdocuments.us/reader035/viewer/2022062316/587614fe1a28ab306c8b65eb/html5/thumbnails/12.jpg)
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
![Page 13: Continuous DB Changes Delivery With Liquibase](https://reader035.vdocuments.us/reader035/viewer/2022062316/587614fe1a28ab306c8b65eb/html5/thumbnails/13.jpg)
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
![Page 14: Continuous DB Changes Delivery With Liquibase](https://reader035.vdocuments.us/reader035/viewer/2022062316/587614fe1a28ab306c8b65eb/html5/thumbnails/14.jpg)
Liquibase vs FlywayFeature 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
![Page 15: Continuous DB Changes Delivery With Liquibase](https://reader035.vdocuments.us/reader035/viewer/2022062316/587614fe1a28ab306c8b65eb/html5/thumbnails/15.jpg)
Documentation• http://www.liquibase.org/documentation/index.html• http://
www.datical.com/wp-content/uploads/2013/09/3-Technical-Brief-Datical-DB.pdf
![Page 16: Continuous DB Changes Delivery With Liquibase](https://reader035.vdocuments.us/reader035/viewer/2022062316/587614fe1a28ab306c8b65eb/html5/thumbnails/16.jpg)
Continuous Delivery With Liquibase DemoHow to continuously deliver DB changes to the PostgreSQL database using Liquibase
![Page 17: Continuous DB Changes Delivery With Liquibase](https://reader035.vdocuments.us/reader035/viewer/2022062316/587614fe1a28ab306c8b65eb/html5/thumbnails/17.jpg)
Solutions Pie
PostgreSQL
Jenkins/Nexus
Git
Maven/Ant/Gradle
Liquibase (Changelogs/Changesets)
![Page 18: Continuous DB Changes Delivery With Liquibase](https://reader035.vdocuments.us/reader035/viewer/2022062316/587614fe1a28ab306c8b65eb/html5/thumbnails/18.jpg)
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
![Page 19: Continuous DB Changes Delivery With Liquibase](https://reader035.vdocuments.us/reader035/viewer/2022062316/587614fe1a28ab306c8b65eb/html5/thumbnails/19.jpg)
Live Example
![Page 20: Continuous DB Changes Delivery With Liquibase](https://reader035.vdocuments.us/reader035/viewer/2022062316/587614fe1a28ab306c8b65eb/html5/thumbnails/20.jpg)
Questions?