SlideShare a Scribd company logo
1 of 44
October 12, 2022 11:00 IST
Mysore MuleSoft Meetup
Liquibase Integration with MuleSoft
Safe Harbour Statement
● Both the speaker and the host are organizing this meet-up in individual capacity only. We are
not representing our companies here.
● This presentation is strictly for learning purposes only. Organizer/Presenter do not hold any
responsibility that same solution will work for your business requirements.
● This presentation is not meant for any promotional activities.
2
A recording of this meetup will be uploaded to events page within 24 hours.
Questions can be submitted/asked at any time in the Chat/Questions & Answers Tab.
Make it more Interactive!!!
Give us feedback! Rate this meetup session by filling feedback form at the end of the day.
We Love Feedbacks!!! Its Bread & Butter for Meetup.
Housekeeping
3
4
● Introductions
● Liquibase
❑ Introduction
❑ Major Concepts
❑ Integrating with MuleSoft Application
❑ Integrating using Spring dependency
● Demo
● Trivia
● Wrap-Up
Agenda
5
A SHOW OF HANDS:
New Members With Us.!!
CHEERS…!!!
We have prizes to give away!
3 lucky winners will receive a MuleSoft voucher!!!
Introduction
● About the Organizers
Giridhar Meka
HashedIn
Sr. Technical Architect
6
Shubham Chaurasia
Billennium India
Professional Integration Developer
A SHOW OF HANDS:
Who is new to this Meetup?
 12+ years of Total Experience.
 4+ years experience in MuleSoft
 Certified Liquibase Fundamentals
 Active member of MuleSoft help forum
 Certified MuleSoft Developer & Architect
 Working as Senior Principal Engineer at Tricon Infotech
Private Limited
● About the Speaker
Shyam Raj Prasad
Tricon Infotech Private Limited
Senior Principal Engineer
Speaker
7
Liquibase
Database Change Management
● Liquibase is an open-source solution
● It is for managing revisions of database schema scripts
● It works across various types of databases
● Supports various file formats for defining the DB structure
What is Liquibase
9
10
• We used to maintain DB scripts (text based) and add them manually to DB
• But there are more issues
○ Easy to lost sync between code and DB state
○ Hard to find out state of particular DB environment
○ Often require to re-create DB from scratch during development
○ Hard to recover from error during development
(Ex: In case of applying wrong statement to DB)
• For these issues, Liquibase is a good solution
Why Liquibase ?
11
• Flyway
• mybatis
• c5-db-migration
• dbdeploy
• MIGRATEdb
• migrate4j
• dbmaintain
• AutoPatch
What are the other similar tools?
12
• Easy setup
• Extensibility
• Database diff report
• Supports for many database types
• Rollback database changes feature
• Database independent migration support
• Java based and easy to manage with java project
• Support for different changelog format
○ —
build-in: XML, YAML, JSON and SQL
How Liquibase is differ from others?
• Compatibility with a broad range of databases such as Oracle, SQL Server, MariaDB
& PostgreSQL.
• Liquibase also works with:
o DB2 on Z.
o Apache Derby and SQLite.
o Oracle ATP, H2 databases & Informix.
• For a complete list of native and community-supported databases, see Liquibase
Getting Started.
• A flexible extension framework that allows for seamless additions of newly released
platforms and integrations.
• Full control of when, where, and how database changes are deployed.
13
Major Features of Liquibase
• Ability to merge changes from multiple developers.
• Code branches.
• Multiple databases.
• Cluster-safe database upgrades.
• Generation of starting changelogs from existing databases.
• Generation of database change documentation.
• Automated updates or generation of SQL.
14
Liquibase Supports
There are two main mechanisms, or concepts, that are the foundation of Liquibase.
These two concepts are:
• Schema Changes which consist of changelogs, changesets & Change Types.
• Tracking tables that record database changes.
15
How Liquibase Works
• Schema changes are the fundamental unit of change in Liquibase.
• In SQL, schema changes are written using SQL statements that create, modify or drop database
objects.
• Examples of typical schema changes are create table, add index and drop column.
• In XML, YAML or JSON the same schema changes are modelled as Liquibase Change Types.
 One or more schema changes (Change Types) are grouped into a changeset. The best practice is to
limit each changeset to only one Change Type.
 One or more changesets are contained in a changelog.
 Changelogs are text files containing schema changes. They should be stored and versioned in your
preferred source control tool.
In addition to containing schema changes, a changelog can include other changelogs. This allows
multiple teams to each work on their own changelogs so they can work independently.
16
Schema Changes
Tracking tables are used to track, version, and deploy database schema changes. If your
database does not contain a tracking table, Liquibase will create one for you.
Liquibase uses two types of tables to track successful schema change deployments:
• DATABASECHANGELOG
• DATABASECHANGELOGLOCK
17
Tracking Tables
The DATABASECHANGELOG table is created and used by Liquibase to track which changesets
have already been run.
It does this by tracking each changeset as a row identified by a combination of ID, author, and
filename specified in the changelog. It is required to make each changeset ID unique in one
changelog file. The author will likely remain the same in every changeset in a changelog, but if
working in a team, it could differ per changeset.
18
DATABASECHANGELOG
To avoid database-specific restrictions on key lengths, there is no primary key on the
tracking table.
Below is an example of how your tracking table will look like
19
DATABASECHANGELOG
To prevent multiple instances of Liquibase running at one time, Liquibase creates and uses a
DATABASECHANGELOGLOCK table behind the scenes. Liquibase uses the
DATABASECHANGELOGLOCK table to prevent other developers, DBAs, or especially automated
processes from being able to execute database changes at the same time.
If multiple instances of Liquibase are running concurrently on the same database a conflict will
occur. The DATABASECHANGELOGLOCK prevents this from happening, which protects your
database.
Below is a sample DATABASECHANGELOGLOCK table.
20
DATABASECHANGELOGLOCK Table
21
• Changelog file
• Changeset
• Changes
• Preconditions
• Contexts
Major Concepts
22
• The root of all Liquibase changes is the databaseChangeLog file.
Change Log File
<databaseChangeLog>
<changeSet id="1" ...>
...
</changeSet>
<changeSet id="2" ...>
...
</changeSet>
</databaseChangeLog>
23
• It is possible to break up changelogs into multiple manageable pieces
Change Log File
<databaseChangeLog>
<include file="src/api/changelog-api-2.1.0.xml"/>
<include file="src/api/changelog-api-2.2.0.xml"/>
<include file="src/api/changelog-api-2.3.0.xml"/>
...
</databaseChangeLog>
24
• The unit Liquibase tracks execution of Database operation.
• Liquibase attempts to execute each changeSet in a transaction that is
committed at the end or rolled back if there is an error.
• Uniquely identified by the "author" & "id" attribute.
• Runs only change sets which are not in executed state yet in
DATABASECHANGELOG table.
Change Set
25
<changeSet id="2.1.0-update-display-order-admin-user-role-event-mgr"
author="Vindya"
dbms="mysql"
context="prod, test">
<comment>Sample of changeset</comment> <!-- comment is optional -->
<change .. /> <!-- will be explained later --</changeSet>
Change Set
26
• Each changeset contains a change which describes the change/refactoring
to apply to the database.
• One change per changeset.
Change
27
• Structural Refactorings
o Add Column
o Rename Column
o Modify Column
o Drop Column
o Alter Sequence
o Create Table
o Rename Table
o Drop Table
o Create View
o Rename View
o Drop View
o Merge Columns
o Create Stored Procedure
Change
28
• Data Quality Refactorings
○ Add Lookup Table
○ Add Not-Null Constraint
○ Remove Not-Null Constraint
○ Add Unique Constraint
○ Drop Unique Constraint
○ Create Sequence
○ Drop Sequence
○ Add Auto-Increment
○ Add Default Value
○ Drop Default Value
Change
29
• Referential Integrity Refactorings
○ Add Foreign Key Constraint
○ Drop Foreign Key Constraint
○ Drop All Foreign Key Constraints
○ Add Primary Key Constraint
○ Drop Primary Key Constraint
• Non-Refactoring Transformations
○ Insert Data
○ Load Data
○ Load Update Data
○ Update Data
○ Delete Data
Change
30
• Architectural Refactorings
○ Create Index
○ Drop Index
○ Custom Refactorings
• Modifying Generated SQL
○ Custom SQL
○ Custom SQL File
○ Custom Refactoring Class
○ Execute Shell Command
Change
31
● Preconditions can be applied to either the changelog as a whole or
individual change sets
● precondition - assertion, that will be evaluated before execution of
changeset.
● If a precondition fails, Liquibase will stop execution
○ check for dbms type
○ check for current user name
○ check if changeset has been executed
○ check if table exists
○ check if table has column
○ check if view exists
○ check if FK constraint exists
Preconditions
<?xml version="1.0" encoding="UTF-8"?>
<changeSet id="1" author=”sfesenko” >
<preConditions onFail="MARK_RAN">
<tableExists tableName="TEST" />
</preConditions>
<dropTable cascadeConstraints="true" tableName=”TEST” />
</changeset>
32
Preconditions
• It’s possible to specify for each changeset in what context it should be run.
• Context value can be specified on Liquibase run.
• Contexts can be applied to changesets to control which are ran in different
environments.
• Example – prod for production and test for test.
33
Changeset Context
• On Demand
o Command Line
o Ant
o Maven
• Automated
o Servlet Listener
o Spring Listener
o JEE CDI Listener
• Java APIs
o Liquibase can easily be embedded and executed through its Java APIs.
34
How to Run?
• Create property file liquibase.property with connection
○ Parameters:
 driver=com.mysql.jdbc.Driver
 classpath=db_changelogs/api
 changeLogFile=changelog-api-master.xml
 username=<username>
 password=<password>
 url=jdbc:mysql://localhost:3306/christie
 logLevel=DEBUG
• Run liquibase as
○ liquibase <command>
35
Command Line
• update - applies to all unrun changes.
• rollback - reverts (rolls back) changes you have made to your database.
• snapshot - used when you want to quickly compare changes in your database or
keep a record of your current database state.
• dbDoc - generates database change documentation.
• diff - allows you to compare two databases of the same type or different types to
one another.
36
Liquibase Common Commands
• diffChangeLog - used when you want to create a deployable changelog to
synchronize multiple databases.
• generateChangeLog - creates a changelog file that has a sequence of changesets
which describes how to re-create the current state of the database.
• history - a helper command that lists out all your deploymentIds and all
changesets associated with each deploymentId.
37
Liquibase Common Commands
• Use one file per changeset (greatly simplified merges)
• Use convention for file names
• Use “run on change” attribute for stored procedures, views, triggers, etc
• Decide early if rollback feature will be used
• Test both incremental and full update
• Do not change “wrong” changeset - just add new one with fix
• Consider possibility of “compressing” changesets when full update became
slow
38
Tips & Tricks
Demo
Q&A
Take a stand !
41
● Nominate yourself for the next meetup speaker and suggest a topic as well.
42
● Share:
○ Tweet using the hashtag #MuleSoftMeetups
○ Join Mysore Group: https://meetups.mulesoft.com/mysore/
● Feedback:
○ Fill out the survey feedback and suggest topics for upcoming events
○ Contact MuleSoft at meetups@mulesoft.com for ways to improve the program
○ Reach out to Mysore Meetup Leaders (Shubham / Giridhar) to suggest
topics for next Meetup
What’s next?
Get ready to WIN a MuleSoft Voucher from MuleSoft
Quiz Time
Thank you

More Related Content

Similar to MuleSoft integration with Liquibase | Mysore MuleSoft Meetup #3

Bringing DevOps to the Database
Bringing DevOps to the DatabaseBringing DevOps to the Database
Bringing DevOps to the DatabaseMichaela Murray
 
KoprowskiT_Session2_SDNEvent_SourceControlForDBA
KoprowskiT_Session2_SDNEvent_SourceControlForDBAKoprowskiT_Session2_SDNEvent_SourceControlForDBA
KoprowskiT_Session2_SDNEvent_SourceControlForDBATobias Koprowski
 
Delivering Changes for Applications and Databases
Delivering Changes for Applications and DatabasesDelivering Changes for Applications and Databases
Delivering Changes for Applications and DatabasesMiguel Alho
 
Introduction To Liquibase
Introduction To Liquibase Introduction To Liquibase
Introduction To Liquibase Knoldus Inc.
 
Using MySQL in Automated Testing
Using MySQL in Automated TestingUsing MySQL in Automated Testing
Using MySQL in Automated TestingMorgan Tocker
 
Database Migrations with Gradle and Liquibase
Database Migrations with Gradle and LiquibaseDatabase Migrations with Gradle and Liquibase
Database Migrations with Gradle and LiquibaseDan Stine
 
Liquibase – a time machine for your data
Liquibase – a time machine for your dataLiquibase – a time machine for your data
Liquibase – a time machine for your dataNeev Technologies
 
Promotional presentation on new Book "MariaDB - Beginners Guide"
Promotional presentation on new Book "MariaDB - Beginners Guide"Promotional presentation on new Book "MariaDB - Beginners Guide"
Promotional presentation on new Book "MariaDB - Beginners Guide"Rodrigo Ribeiro
 
Powering GIS Application with PostgreSQL and Postgres Plus
Powering GIS Application with PostgreSQL and Postgres Plus Powering GIS Application with PostgreSQL and Postgres Plus
Powering GIS Application with PostgreSQL and Postgres Plus Ashnikbiz
 
OSA Con 2022 - Extract, Transform, and Learn about your developers - Brian Le...
OSA Con 2022 - Extract, Transform, and Learn about your developers - Brian Le...OSA Con 2022 - Extract, Transform, and Learn about your developers - Brian Le...
OSA Con 2022 - Extract, Transform, and Learn about your developers - Brian Le...Altinity Ltd
 
Ten query tuning techniques every SQL Server programmer should know
Ten query tuning techniques every SQL Server programmer should knowTen query tuning techniques every SQL Server programmer should know
Ten query tuning techniques every SQL Server programmer should knowKevin Kline
 
Delivering changes for applications and databases
Delivering changes for applications and databasesDelivering changes for applications and databases
Delivering changes for applications and databasesEduardo Piairo
 
Weblogic server-overview-weblogic-scripting-tool0-1228252752844434-9
Weblogic server-overview-weblogic-scripting-tool0-1228252752844434-9Weblogic server-overview-weblogic-scripting-tool0-1228252752844434-9
Weblogic server-overview-weblogic-scripting-tool0-1228252752844434-9Bhaskar Naik
 
Why retail companies can't afford database downtime
Why retail companies can't afford database downtimeWhy retail companies can't afford database downtime
Why retail companies can't afford database downtimeDBmaestro - Database DevOps
 
OpenNTF Webinar, October 2020
OpenNTF Webinar, October 2020OpenNTF Webinar, October 2020
OpenNTF Webinar, October 2020Howard Greenberg
 
DevOps+Data: Working with Source Control
DevOps+Data: Working with Source ControlDevOps+Data: Working with Source Control
DevOps+Data: Working with Source ControlEd Leighton-Dick
 
What is new in MariaDB 10.6?
What is new in MariaDB 10.6?What is new in MariaDB 10.6?
What is new in MariaDB 10.6?Mydbops
 
Technical Introduction to PostgreSQL and PPAS
Technical Introduction to PostgreSQL and PPASTechnical Introduction to PostgreSQL and PPAS
Technical Introduction to PostgreSQL and PPASAshnikbiz
 

Similar to MuleSoft integration with Liquibase | Mysore MuleSoft Meetup #3 (20)

Bringing DevOps to the Database
Bringing DevOps to the DatabaseBringing DevOps to the Database
Bringing DevOps to the Database
 
KoprowskiT_Session2_SDNEvent_SourceControlForDBA
KoprowskiT_Session2_SDNEvent_SourceControlForDBAKoprowskiT_Session2_SDNEvent_SourceControlForDBA
KoprowskiT_Session2_SDNEvent_SourceControlForDBA
 
Delivering Changes for Applications and Databases
Delivering Changes for Applications and DatabasesDelivering Changes for Applications and Databases
Delivering Changes for Applications and Databases
 
Introduction To Liquibase
Introduction To Liquibase Introduction To Liquibase
Introduction To Liquibase
 
Using MySQL in Automated Testing
Using MySQL in Automated TestingUsing MySQL in Automated Testing
Using MySQL in Automated Testing
 
Database Migrations with Gradle and Liquibase
Database Migrations with Gradle and LiquibaseDatabase Migrations with Gradle and Liquibase
Database Migrations with Gradle and Liquibase
 
Liquibase – a time machine for your data
Liquibase – a time machine for your dataLiquibase – a time machine for your data
Liquibase – a time machine for your data
 
Promotional presentation on new Book "MariaDB - Beginners Guide"
Promotional presentation on new Book "MariaDB - Beginners Guide"Promotional presentation on new Book "MariaDB - Beginners Guide"
Promotional presentation on new Book "MariaDB - Beginners Guide"
 
Powering GIS Application with PostgreSQL and Postgres Plus
Powering GIS Application with PostgreSQL and Postgres Plus Powering GIS Application with PostgreSQL and Postgres Plus
Powering GIS Application with PostgreSQL and Postgres Plus
 
OSA Con 2022 - Extract, Transform, and Learn about your developers - Brian Le...
OSA Con 2022 - Extract, Transform, and Learn about your developers - Brian Le...OSA Con 2022 - Extract, Transform, and Learn about your developers - Brian Le...
OSA Con 2022 - Extract, Transform, and Learn about your developers - Brian Le...
 
Ten query tuning techniques every SQL Server programmer should know
Ten query tuning techniques every SQL Server programmer should knowTen query tuning techniques every SQL Server programmer should know
Ten query tuning techniques every SQL Server programmer should know
 
Delivering changes for applications and databases
Delivering changes for applications and databasesDelivering changes for applications and databases
Delivering changes for applications and databases
 
LiquiBase
LiquiBaseLiquiBase
LiquiBase
 
Weblogic server-overview-weblogic-scripting-tool0-1228252752844434-9
Weblogic server-overview-weblogic-scripting-tool0-1228252752844434-9Weblogic server-overview-weblogic-scripting-tool0-1228252752844434-9
Weblogic server-overview-weblogic-scripting-tool0-1228252752844434-9
 
Why retail companies can't afford database downtime
Why retail companies can't afford database downtimeWhy retail companies can't afford database downtime
Why retail companies can't afford database downtime
 
OpenNTF Webinar, October 2020
OpenNTF Webinar, October 2020OpenNTF Webinar, October 2020
OpenNTF Webinar, October 2020
 
DevOps+Data: Working with Source Control
DevOps+Data: Working with Source ControlDevOps+Data: Working with Source Control
DevOps+Data: Working with Source Control
 
What is new in MariaDB 10.6?
What is new in MariaDB 10.6?What is new in MariaDB 10.6?
What is new in MariaDB 10.6?
 
Rails data migrations
Rails data migrationsRails data migrations
Rails data migrations
 
Technical Introduction to PostgreSQL and PPAS
Technical Introduction to PostgreSQL and PPASTechnical Introduction to PostgreSQL and PPAS
Technical Introduction to PostgreSQL and PPAS
 

More from MysoreMuleSoftMeetup

MuleSoft Integration with AWS Lambda [Serverless Function] | MuleSoft Mysore ...
MuleSoft Integration with AWS Lambda [Serverless Function] | MuleSoft Mysore ...MuleSoft Integration with AWS Lambda [Serverless Function] | MuleSoft Mysore ...
MuleSoft Integration with AWS Lambda [Serverless Function] | MuleSoft Mysore ...MysoreMuleSoftMeetup
 
Munits in Mule 4 [Deep-Dive] | MuleSoft Mysore Meetup #40
Munits in Mule 4 [Deep-Dive] | MuleSoft Mysore Meetup #40Munits in Mule 4 [Deep-Dive] | MuleSoft Mysore Meetup #40
Munits in Mule 4 [Deep-Dive] | MuleSoft Mysore Meetup #40MysoreMuleSoftMeetup
 
Unlocking Seamless End-to-End Automation with the MuleSoft Automation Suite |...
Unlocking Seamless End-to-End Automation with the MuleSoft Automation Suite |...Unlocking Seamless End-to-End Automation with the MuleSoft Automation Suite |...
Unlocking Seamless End-to-End Automation with the MuleSoft Automation Suite |...MysoreMuleSoftMeetup
 
State Management in Mule applications | MuleSoft Mysore Meetup #42
State Management in Mule applications |  MuleSoft Mysore Meetup #42State Management in Mule applications |  MuleSoft Mysore Meetup #42
State Management in Mule applications | MuleSoft Mysore Meetup #42MysoreMuleSoftMeetup
 
Anypoint Code Builder (ACB) + AI + Hands-On | MuleSoft Mysore Meetup #41
Anypoint Code Builder (ACB) + AI + Hands-On |  MuleSoft Mysore Meetup #41Anypoint Code Builder (ACB) + AI + Hands-On |  MuleSoft Mysore Meetup #41
Anypoint Code Builder (ACB) + AI + Hands-On | MuleSoft Mysore Meetup #41MysoreMuleSoftMeetup
 
Transaction Management in Mule 4 | MuleSoft Mysore Meetup #39
Transaction Management in Mule 4 |  MuleSoft Mysore Meetup #39Transaction Management in Mule 4 |  MuleSoft Mysore Meetup #39
Transaction Management in Mule 4 | MuleSoft Mysore Meetup #39MysoreMuleSoftMeetup
 
Exploring the realms of MuleSoft RPA | MuleSoft Mysore Meetup #38
Exploring the realms of MuleSoft RPA | MuleSoft Mysore Meetup #38Exploring the realms of MuleSoft RPA | MuleSoft Mysore Meetup #38
Exploring the realms of MuleSoft RPA | MuleSoft Mysore Meetup #38MysoreMuleSoftMeetup
 
Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37
Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37
Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37MysoreMuleSoftMeetup
 
Azure DevOps Pipeline setup for Mule APIs #36
Azure DevOps Pipeline setup for Mule APIs #36Azure DevOps Pipeline setup for Mule APIs #36
Azure DevOps Pipeline setup for Mule APIs #36MysoreMuleSoftMeetup
 
Mastering the Puzzle Integration Patterns Decoded | MuleSoft Mysore Meetup #35
Mastering the Puzzle Integration Patterns Decoded | MuleSoft Mysore Meetup #35Mastering the Puzzle Integration Patterns Decoded | MuleSoft Mysore Meetup #35
Mastering the Puzzle Integration Patterns Decoded | MuleSoft Mysore Meetup #35MysoreMuleSoftMeetup
 
Discovering Seamless Integration: MuleSoft, AWS and Snowflake | MuleSoft Myso...
Discovering Seamless Integration: MuleSoft, AWS and Snowflake | MuleSoft Myso...Discovering Seamless Integration: MuleSoft, AWS and Snowflake | MuleSoft Myso...
Discovering Seamless Integration: MuleSoft, AWS and Snowflake | MuleSoft Myso...MysoreMuleSoftMeetup
 
Application Design Thinking wrt Integration Architecture - Part II | MuleSoft...
Application Design Thinking wrt Integration Architecture - Part II | MuleSoft...Application Design Thinking wrt Integration Architecture - Part II | MuleSoft...
Application Design Thinking wrt Integration Architecture - Part II | MuleSoft...MysoreMuleSoftMeetup
 
HL7 Integration using Mulesoft | MuleSoft Mysore Meetp #32
HL7 Integration using Mulesoft | MuleSoft Mysore Meetp #32HL7 Integration using Mulesoft | MuleSoft Mysore Meetp #32
HL7 Integration using Mulesoft | MuleSoft Mysore Meetp #32MysoreMuleSoftMeetup
 
Application Design Thinking wrt Integration Architecture - Part I | MuleSoft ...
Application Design Thinking wrt Integration Architecture - Part I | MuleSoft ...Application Design Thinking wrt Integration Architecture - Part I | MuleSoft ...
Application Design Thinking wrt Integration Architecture - Part I | MuleSoft ...MysoreMuleSoftMeetup
 
Slack and ChatGPT Integration using MuleSoft | MuleSoft Mysore Meetup #30
Slack and ChatGPT Integration using MuleSoft | MuleSoft Mysore Meetup #30Slack and ChatGPT Integration using MuleSoft | MuleSoft Mysore Meetup #30
Slack and ChatGPT Integration using MuleSoft | MuleSoft Mysore Meetup #30MysoreMuleSoftMeetup
 
Platform configuration on CloudHub 2.0 | MuleSoft Mysore Meetup #29
Platform configuration on CloudHub 2.0 | MuleSoft Mysore Meetup #29Platform configuration on CloudHub 2.0 | MuleSoft Mysore Meetup #29
Platform configuration on CloudHub 2.0 | MuleSoft Mysore Meetup #29MysoreMuleSoftMeetup
 
MuleSoft Integration with ChatGPT — Part 1 | MuleSoft Mysore Meetup #27
MuleSoft Integration with ChatGPT — Part 1 | MuleSoft Mysore Meetup #27MuleSoft Integration with ChatGPT — Part 1 | MuleSoft Mysore Meetup #27
MuleSoft Integration with ChatGPT — Part 1 | MuleSoft Mysore Meetup #27MysoreMuleSoftMeetup
 
Handling NFRs for the API through API policies (Custom Policies) -Part 2 | Mu...
Handling NFRs for the API through API policies (Custom Policies) -Part 2 | Mu...Handling NFRs for the API through API policies (Custom Policies) -Part 2 | Mu...
Handling NFRs for the API through API policies (Custom Policies) -Part 2 | Mu...MysoreMuleSoftMeetup
 
Handling NFRs for the API through OoTB API policies Part-1 | MuleSoft Mysore ...
Handling NFRs for the API through OoTB API policies Part-1 | MuleSoft Mysore ...Handling NFRs for the API through OoTB API policies Part-1 | MuleSoft Mysore ...
Handling NFRs for the API through OoTB API policies Part-1 | MuleSoft Mysore ...MysoreMuleSoftMeetup
 
Maven Archetypes - Learn about importance of Maven Archetypes in MuleSoft | M...
Maven Archetypes - Learn about importance of Maven Archetypes in MuleSoft | M...Maven Archetypes - Learn about importance of Maven Archetypes in MuleSoft | M...
Maven Archetypes - Learn about importance of Maven Archetypes in MuleSoft | M...MysoreMuleSoftMeetup
 

More from MysoreMuleSoftMeetup (20)

MuleSoft Integration with AWS Lambda [Serverless Function] | MuleSoft Mysore ...
MuleSoft Integration with AWS Lambda [Serverless Function] | MuleSoft Mysore ...MuleSoft Integration with AWS Lambda [Serverless Function] | MuleSoft Mysore ...
MuleSoft Integration with AWS Lambda [Serverless Function] | MuleSoft Mysore ...
 
Munits in Mule 4 [Deep-Dive] | MuleSoft Mysore Meetup #40
Munits in Mule 4 [Deep-Dive] | MuleSoft Mysore Meetup #40Munits in Mule 4 [Deep-Dive] | MuleSoft Mysore Meetup #40
Munits in Mule 4 [Deep-Dive] | MuleSoft Mysore Meetup #40
 
Unlocking Seamless End-to-End Automation with the MuleSoft Automation Suite |...
Unlocking Seamless End-to-End Automation with the MuleSoft Automation Suite |...Unlocking Seamless End-to-End Automation with the MuleSoft Automation Suite |...
Unlocking Seamless End-to-End Automation with the MuleSoft Automation Suite |...
 
State Management in Mule applications | MuleSoft Mysore Meetup #42
State Management in Mule applications |  MuleSoft Mysore Meetup #42State Management in Mule applications |  MuleSoft Mysore Meetup #42
State Management in Mule applications | MuleSoft Mysore Meetup #42
 
Anypoint Code Builder (ACB) + AI + Hands-On | MuleSoft Mysore Meetup #41
Anypoint Code Builder (ACB) + AI + Hands-On |  MuleSoft Mysore Meetup #41Anypoint Code Builder (ACB) + AI + Hands-On |  MuleSoft Mysore Meetup #41
Anypoint Code Builder (ACB) + AI + Hands-On | MuleSoft Mysore Meetup #41
 
Transaction Management in Mule 4 | MuleSoft Mysore Meetup #39
Transaction Management in Mule 4 |  MuleSoft Mysore Meetup #39Transaction Management in Mule 4 |  MuleSoft Mysore Meetup #39
Transaction Management in Mule 4 | MuleSoft Mysore Meetup #39
 
Exploring the realms of MuleSoft RPA | MuleSoft Mysore Meetup #38
Exploring the realms of MuleSoft RPA | MuleSoft Mysore Meetup #38Exploring the realms of MuleSoft RPA | MuleSoft Mysore Meetup #38
Exploring the realms of MuleSoft RPA | MuleSoft Mysore Meetup #38
 
Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37
Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37
Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37
 
Azure DevOps Pipeline setup for Mule APIs #36
Azure DevOps Pipeline setup for Mule APIs #36Azure DevOps Pipeline setup for Mule APIs #36
Azure DevOps Pipeline setup for Mule APIs #36
 
Mastering the Puzzle Integration Patterns Decoded | MuleSoft Mysore Meetup #35
Mastering the Puzzle Integration Patterns Decoded | MuleSoft Mysore Meetup #35Mastering the Puzzle Integration Patterns Decoded | MuleSoft Mysore Meetup #35
Mastering the Puzzle Integration Patterns Decoded | MuleSoft Mysore Meetup #35
 
Discovering Seamless Integration: MuleSoft, AWS and Snowflake | MuleSoft Myso...
Discovering Seamless Integration: MuleSoft, AWS and Snowflake | MuleSoft Myso...Discovering Seamless Integration: MuleSoft, AWS and Snowflake | MuleSoft Myso...
Discovering Seamless Integration: MuleSoft, AWS and Snowflake | MuleSoft Myso...
 
Application Design Thinking wrt Integration Architecture - Part II | MuleSoft...
Application Design Thinking wrt Integration Architecture - Part II | MuleSoft...Application Design Thinking wrt Integration Architecture - Part II | MuleSoft...
Application Design Thinking wrt Integration Architecture - Part II | MuleSoft...
 
HL7 Integration using Mulesoft | MuleSoft Mysore Meetp #32
HL7 Integration using Mulesoft | MuleSoft Mysore Meetp #32HL7 Integration using Mulesoft | MuleSoft Mysore Meetp #32
HL7 Integration using Mulesoft | MuleSoft Mysore Meetp #32
 
Application Design Thinking wrt Integration Architecture - Part I | MuleSoft ...
Application Design Thinking wrt Integration Architecture - Part I | MuleSoft ...Application Design Thinking wrt Integration Architecture - Part I | MuleSoft ...
Application Design Thinking wrt Integration Architecture - Part I | MuleSoft ...
 
Slack and ChatGPT Integration using MuleSoft | MuleSoft Mysore Meetup #30
Slack and ChatGPT Integration using MuleSoft | MuleSoft Mysore Meetup #30Slack and ChatGPT Integration using MuleSoft | MuleSoft Mysore Meetup #30
Slack and ChatGPT Integration using MuleSoft | MuleSoft Mysore Meetup #30
 
Platform configuration on CloudHub 2.0 | MuleSoft Mysore Meetup #29
Platform configuration on CloudHub 2.0 | MuleSoft Mysore Meetup #29Platform configuration on CloudHub 2.0 | MuleSoft Mysore Meetup #29
Platform configuration on CloudHub 2.0 | MuleSoft Mysore Meetup #29
 
MuleSoft Integration with ChatGPT — Part 1 | MuleSoft Mysore Meetup #27
MuleSoft Integration with ChatGPT — Part 1 | MuleSoft Mysore Meetup #27MuleSoft Integration with ChatGPT — Part 1 | MuleSoft Mysore Meetup #27
MuleSoft Integration with ChatGPT — Part 1 | MuleSoft Mysore Meetup #27
 
Handling NFRs for the API through API policies (Custom Policies) -Part 2 | Mu...
Handling NFRs for the API through API policies (Custom Policies) -Part 2 | Mu...Handling NFRs for the API through API policies (Custom Policies) -Part 2 | Mu...
Handling NFRs for the API through API policies (Custom Policies) -Part 2 | Mu...
 
Handling NFRs for the API through OoTB API policies Part-1 | MuleSoft Mysore ...
Handling NFRs for the API through OoTB API policies Part-1 | MuleSoft Mysore ...Handling NFRs for the API through OoTB API policies Part-1 | MuleSoft Mysore ...
Handling NFRs for the API through OoTB API policies Part-1 | MuleSoft Mysore ...
 
Maven Archetypes - Learn about importance of Maven Archetypes in MuleSoft | M...
Maven Archetypes - Learn about importance of Maven Archetypes in MuleSoft | M...Maven Archetypes - Learn about importance of Maven Archetypes in MuleSoft | M...
Maven Archetypes - Learn about importance of Maven Archetypes in MuleSoft | M...
 

Recently uploaded

Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitolTechU
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 

Recently uploaded (20)

Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptx
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 

MuleSoft integration with Liquibase | Mysore MuleSoft Meetup #3

  • 1. October 12, 2022 11:00 IST Mysore MuleSoft Meetup Liquibase Integration with MuleSoft
  • 2. Safe Harbour Statement ● Both the speaker and the host are organizing this meet-up in individual capacity only. We are not representing our companies here. ● This presentation is strictly for learning purposes only. Organizer/Presenter do not hold any responsibility that same solution will work for your business requirements. ● This presentation is not meant for any promotional activities. 2
  • 3. A recording of this meetup will be uploaded to events page within 24 hours. Questions can be submitted/asked at any time in the Chat/Questions & Answers Tab. Make it more Interactive!!! Give us feedback! Rate this meetup session by filling feedback form at the end of the day. We Love Feedbacks!!! Its Bread & Butter for Meetup. Housekeeping 3
  • 4. 4 ● Introductions ● Liquibase ❑ Introduction ❑ Major Concepts ❑ Integrating with MuleSoft Application ❑ Integrating using Spring dependency ● Demo ● Trivia ● Wrap-Up Agenda
  • 5. 5 A SHOW OF HANDS: New Members With Us.!! CHEERS…!!! We have prizes to give away! 3 lucky winners will receive a MuleSoft voucher!!!
  • 6. Introduction ● About the Organizers Giridhar Meka HashedIn Sr. Technical Architect 6 Shubham Chaurasia Billennium India Professional Integration Developer A SHOW OF HANDS: Who is new to this Meetup?
  • 7.  12+ years of Total Experience.  4+ years experience in MuleSoft  Certified Liquibase Fundamentals  Active member of MuleSoft help forum  Certified MuleSoft Developer & Architect  Working as Senior Principal Engineer at Tricon Infotech Private Limited ● About the Speaker Shyam Raj Prasad Tricon Infotech Private Limited Senior Principal Engineer Speaker 7
  • 9. ● Liquibase is an open-source solution ● It is for managing revisions of database schema scripts ● It works across various types of databases ● Supports various file formats for defining the DB structure What is Liquibase 9
  • 10. 10 • We used to maintain DB scripts (text based) and add them manually to DB • But there are more issues ○ Easy to lost sync between code and DB state ○ Hard to find out state of particular DB environment ○ Often require to re-create DB from scratch during development ○ Hard to recover from error during development (Ex: In case of applying wrong statement to DB) • For these issues, Liquibase is a good solution Why Liquibase ?
  • 11. 11 • Flyway • mybatis • c5-db-migration • dbdeploy • MIGRATEdb • migrate4j • dbmaintain • AutoPatch What are the other similar tools?
  • 12. 12 • Easy setup • Extensibility • Database diff report • Supports for many database types • Rollback database changes feature • Database independent migration support • Java based and easy to manage with java project • Support for different changelog format ○ — build-in: XML, YAML, JSON and SQL How Liquibase is differ from others?
  • 13. • Compatibility with a broad range of databases such as Oracle, SQL Server, MariaDB & PostgreSQL. • Liquibase also works with: o DB2 on Z. o Apache Derby and SQLite. o Oracle ATP, H2 databases & Informix. • For a complete list of native and community-supported databases, see Liquibase Getting Started. • A flexible extension framework that allows for seamless additions of newly released platforms and integrations. • Full control of when, where, and how database changes are deployed. 13 Major Features of Liquibase
  • 14. • Ability to merge changes from multiple developers. • Code branches. • Multiple databases. • Cluster-safe database upgrades. • Generation of starting changelogs from existing databases. • Generation of database change documentation. • Automated updates or generation of SQL. 14 Liquibase Supports
  • 15. There are two main mechanisms, or concepts, that are the foundation of Liquibase. These two concepts are: • Schema Changes which consist of changelogs, changesets & Change Types. • Tracking tables that record database changes. 15 How Liquibase Works
  • 16. • Schema changes are the fundamental unit of change in Liquibase. • In SQL, schema changes are written using SQL statements that create, modify or drop database objects. • Examples of typical schema changes are create table, add index and drop column. • In XML, YAML or JSON the same schema changes are modelled as Liquibase Change Types.  One or more schema changes (Change Types) are grouped into a changeset. The best practice is to limit each changeset to only one Change Type.  One or more changesets are contained in a changelog.  Changelogs are text files containing schema changes. They should be stored and versioned in your preferred source control tool. In addition to containing schema changes, a changelog can include other changelogs. This allows multiple teams to each work on their own changelogs so they can work independently. 16 Schema Changes
  • 17. Tracking tables are used to track, version, and deploy database schema changes. If your database does not contain a tracking table, Liquibase will create one for you. Liquibase uses two types of tables to track successful schema change deployments: • DATABASECHANGELOG • DATABASECHANGELOGLOCK 17 Tracking Tables
  • 18. The DATABASECHANGELOG table is created and used by Liquibase to track which changesets have already been run. It does this by tracking each changeset as a row identified by a combination of ID, author, and filename specified in the changelog. It is required to make each changeset ID unique in one changelog file. The author will likely remain the same in every changeset in a changelog, but if working in a team, it could differ per changeset. 18 DATABASECHANGELOG
  • 19. To avoid database-specific restrictions on key lengths, there is no primary key on the tracking table. Below is an example of how your tracking table will look like 19 DATABASECHANGELOG
  • 20. To prevent multiple instances of Liquibase running at one time, Liquibase creates and uses a DATABASECHANGELOGLOCK table behind the scenes. Liquibase uses the DATABASECHANGELOGLOCK table to prevent other developers, DBAs, or especially automated processes from being able to execute database changes at the same time. If multiple instances of Liquibase are running concurrently on the same database a conflict will occur. The DATABASECHANGELOGLOCK prevents this from happening, which protects your database. Below is a sample DATABASECHANGELOGLOCK table. 20 DATABASECHANGELOGLOCK Table
  • 21. 21 • Changelog file • Changeset • Changes • Preconditions • Contexts Major Concepts
  • 22. 22 • The root of all Liquibase changes is the databaseChangeLog file. Change Log File <databaseChangeLog> <changeSet id="1" ...> ... </changeSet> <changeSet id="2" ...> ... </changeSet> </databaseChangeLog>
  • 23. 23 • It is possible to break up changelogs into multiple manageable pieces Change Log File <databaseChangeLog> <include file="src/api/changelog-api-2.1.0.xml"/> <include file="src/api/changelog-api-2.2.0.xml"/> <include file="src/api/changelog-api-2.3.0.xml"/> ... </databaseChangeLog>
  • 24. 24 • The unit Liquibase tracks execution of Database operation. • Liquibase attempts to execute each changeSet in a transaction that is committed at the end or rolled back if there is an error. • Uniquely identified by the "author" & "id" attribute. • Runs only change sets which are not in executed state yet in DATABASECHANGELOG table. Change Set
  • 25. 25 <changeSet id="2.1.0-update-display-order-admin-user-role-event-mgr" author="Vindya" dbms="mysql" context="prod, test"> <comment>Sample of changeset</comment> <!-- comment is optional --> <change .. /> <!-- will be explained later --</changeSet> Change Set
  • 26. 26 • Each changeset contains a change which describes the change/refactoring to apply to the database. • One change per changeset. Change
  • 27. 27 • Structural Refactorings o Add Column o Rename Column o Modify Column o Drop Column o Alter Sequence o Create Table o Rename Table o Drop Table o Create View o Rename View o Drop View o Merge Columns o Create Stored Procedure Change
  • 28. 28 • Data Quality Refactorings ○ Add Lookup Table ○ Add Not-Null Constraint ○ Remove Not-Null Constraint ○ Add Unique Constraint ○ Drop Unique Constraint ○ Create Sequence ○ Drop Sequence ○ Add Auto-Increment ○ Add Default Value ○ Drop Default Value Change
  • 29. 29 • Referential Integrity Refactorings ○ Add Foreign Key Constraint ○ Drop Foreign Key Constraint ○ Drop All Foreign Key Constraints ○ Add Primary Key Constraint ○ Drop Primary Key Constraint • Non-Refactoring Transformations ○ Insert Data ○ Load Data ○ Load Update Data ○ Update Data ○ Delete Data Change
  • 30. 30 • Architectural Refactorings ○ Create Index ○ Drop Index ○ Custom Refactorings • Modifying Generated SQL ○ Custom SQL ○ Custom SQL File ○ Custom Refactoring Class ○ Execute Shell Command Change
  • 31. 31 ● Preconditions can be applied to either the changelog as a whole or individual change sets ● precondition - assertion, that will be evaluated before execution of changeset. ● If a precondition fails, Liquibase will stop execution ○ check for dbms type ○ check for current user name ○ check if changeset has been executed ○ check if table exists ○ check if table has column ○ check if view exists ○ check if FK constraint exists Preconditions
  • 32. <?xml version="1.0" encoding="UTF-8"?> <changeSet id="1" author=”sfesenko” > <preConditions onFail="MARK_RAN"> <tableExists tableName="TEST" /> </preConditions> <dropTable cascadeConstraints="true" tableName=”TEST” /> </changeset> 32 Preconditions
  • 33. • It’s possible to specify for each changeset in what context it should be run. • Context value can be specified on Liquibase run. • Contexts can be applied to changesets to control which are ran in different environments. • Example – prod for production and test for test. 33 Changeset Context
  • 34. • On Demand o Command Line o Ant o Maven • Automated o Servlet Listener o Spring Listener o JEE CDI Listener • Java APIs o Liquibase can easily be embedded and executed through its Java APIs. 34 How to Run?
  • 35. • Create property file liquibase.property with connection ○ Parameters:  driver=com.mysql.jdbc.Driver  classpath=db_changelogs/api  changeLogFile=changelog-api-master.xml  username=<username>  password=<password>  url=jdbc:mysql://localhost:3306/christie  logLevel=DEBUG • Run liquibase as ○ liquibase <command> 35 Command Line
  • 36. • update - applies to all unrun changes. • rollback - reverts (rolls back) changes you have made to your database. • snapshot - used when you want to quickly compare changes in your database or keep a record of your current database state. • dbDoc - generates database change documentation. • diff - allows you to compare two databases of the same type or different types to one another. 36 Liquibase Common Commands
  • 37. • diffChangeLog - used when you want to create a deployable changelog to synchronize multiple databases. • generateChangeLog - creates a changelog file that has a sequence of changesets which describes how to re-create the current state of the database. • history - a helper command that lists out all your deploymentIds and all changesets associated with each deploymentId. 37 Liquibase Common Commands
  • 38. • Use one file per changeset (greatly simplified merges) • Use convention for file names • Use “run on change” attribute for stored procedures, views, triggers, etc • Decide early if rollback feature will be used • Test both incremental and full update • Do not change “wrong” changeset - just add new one with fix • Consider possibility of “compressing” changesets when full update became slow 38 Tips & Tricks
  • 39. Demo
  • 40. Q&A
  • 41. Take a stand ! 41 ● Nominate yourself for the next meetup speaker and suggest a topic as well.
  • 42. 42 ● Share: ○ Tweet using the hashtag #MuleSoftMeetups ○ Join Mysore Group: https://meetups.mulesoft.com/mysore/ ● Feedback: ○ Fill out the survey feedback and suggest topics for upcoming events ○ Contact MuleSoft at meetups@mulesoft.com for ways to improve the program ○ Reach out to Mysore Meetup Leaders (Shubham / Giridhar) to suggest topics for next Meetup What’s next?
  • 43. Get ready to WIN a MuleSoft Voucher from MuleSoft Quiz Time