Liquibase is an open-source database-independent library for tracking, managing and applying database schema changes. We will learn the basics of liquibase and why it is used and its advantages.
2. Lack of etiquette and manners is a huge turn off.
KnolX Etiquettes
Punctuality
Join the session 5 minutes prior
to the session start time. We
start on time and conclude on
time!
Feedback
Make sure to submit a
constructive feedback for all
sessions as it is very helpful for
the presenter.
Silent Mode
Keep your mobile devices in
silent mode, feel free to move
out of session in case you need
to attend an urgent call.
Avoid Disturbance
Avoid unwanted chit chat during
the session.
3. Our Agenda
Introduction To Liquibase
01 Why Database versioning is required?
02 What is Liquibase?
03 Which Database and languages do liquibase
support?
04 Why Liquibase? Problems with manual changes? Speciality
of Liquibase
05 Liquibase commands, installation and demo
4. Why Database Versioning is required?
● Frequent revision is at the heart of most agile projects. So the developers frequently
receive requirement revisions, application code changes, database schema revisions
across the sprints.
● Though it is easy to understand that the code and application would change a revisions
occur, developers generally are not comfortable in handling DB versions.
● Any time a build needs to be reverted to a previous version, DB schema rollback also
needs to be done with without a professional tool is not very straightforward.
● A source control tool for DB schema is as necessary as tools for source code control like
GIT.
● You may also put a point forward that why don’t we keep the schema definition as SQL
scripts in GIT?
● This may help in re-creating the DB but when it comes to dropping just a column or
changing the datatype, entire DDL script may be too expensive in terms of data
restoration and time taken.
● Hence database versioning is as mandatory as code versioning.
8. Why Liquibase?
● Consistent database changes.
● Manage databases at different states.
● Keep a history of changes.
● Automatic rollback support.
● Ability of Automation.
● Effectively manage variable change.
● Less human resources/errors.
9. Problems of Manual Changes
● Inconsistent application of changes.
● Ineffective mechanisms for managing changes.
● Database changes may or may not have been
communicated to the team.
● Databases may become out of sync between
environments.
10. What is special about Liquibase?
ChangeLogs
ChangeSets
Tracking Tables
11. Liquibase Commands
Below are common commands used when working with Liquibase.
They include:
● 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.
● diff - allows you to compare two databases of the same type or
different types to one another.
● diff-changelog - used when you want to create a deployable
changelog to synchronize multiple databases.
● history - a helper command that lists out all your deploymentIds
and all changesets associated with each deploymentId.
12. Advantages of Liquibase
● Ability to have the same change description on multiple database types.
● Ability to have if/then logic in what is applied.
● Generated documentation of database history.
● Ability to specify more complex, multi-statement changes easily.
13. Liquibase Installation
You can simply go to the mentin URL and download Liquibase according to your OS -
https://www.liquibase.com/download