SlideShare a Scribd company logo
1 of 18
Download to read offline
Presented By: Muskan Gupta
Flyway : A Database
Version Management Tool
Lack of etiquette and manners is a huge turn off.
KnolX Etiquettes
Punctuality
Respect Knolx session timings, you
are requested not to join sessions
after a 5 minutes threshold post
the session start time.
Feedback
Make sure to submit a constructive
feedback for all sessions as it is
very helpful for the presenter.
Silent Mode
Keep your screen on mute if there
is nothing to say.
Our Agenda
01 Naive approach to handle Database
02 What is Database Version Control?
03 Importance of Version Control
04 Flyway: Database Version Control Tool
05 How Flyway Works?
06 Flyway Migrations
07 Flyway Commands
08 Demo
Naive approach to handle Database
XYZ Database
XYZ Project
XYZ Database
XYZ Project
XYZ Database
XYZ Project
XYZ Database
XYZ Project
XYZ Database
XYZ Project
XYZ Database
XYZ Project
XYZ Database
XYZ Project
XYZ Database
XYZ Project
XYZ Database
XYZ Project
XYZ Database
XYZ Project
XYZ Database
XYZ Project
XYZ Database
XYZ Project
Multiple Users
Multiple Environments
XYZ Databse
XYZ Project
Naive approach to handle Database
Problems with Naive approach -
● What state is the database in on this machine?
● Has this script already been applied or not?
● Has the quick fix in production been applied in test afterwards?
● How do you set up a new database instance?
What is Database Version Control?
● Database version control is similar to application version control.
● Keep the track of all the changes done to your database by all the team members.
● We need to store the Data Definition Language (DDL) code for a database in a version control system.
● Also it should maintain a history of all the changes done to the database.
Importance of Version Control
03 04
Better Collaboration
Between Team
Members
Efficient and Scalable
Deployments
01 02
Single Source of Truth Increased Visibility
05 06
Database Rollbacks Database Automation
Flyway : Database Version Control Tool
● Version Control for your Database
● An Open Source tool for migration based database version control.
● It has a community as well as a teams version.
● Community Support is available for free version and Redgate Support is available for paid version.
● It provides multiple ways to use flyway. It has :
○ Command Line Client
○ API
○ Maven
○ Gradle
How Flyway Works?
Empty Database
Flyway
Migrations
How Flyway Works?
1. Try to locate schema history table.
A schema history table is a table that flyway uses to maintain the version. By having a look at the table flyway decides which
migrations need to be applied and which migrations have already been implemented.
2. If schema history table is not found flyway will create the table in primary/default schema.
3. After creation of table, it will try to locate all the migrations at the migration location provided in configuration.
4. According to the version it will apply the migrations one by one in incremental fashion
and update schema history table accordingly.
Flyway Migrations
In terms of Flyway all the changes to the database are temed as Migrations.
Migrations are of 2 types :
● Versioned migration
○ Regular Versioned Migration
○ Undo Migration
● Repeatable migrationf
Migrations can be written both in SQL and in Java.
Flyway automatically discovers migrations on the filesystem and on the Java classpath.
Within a single migration run, versioned migrations are applied first as per their version and repeatable migrations
are always applied last, after all versioned migrations have been executed. Repeatable migrations are applied in
the order of their description.
Versioned Migrations
From Flyway Documentation :
Versioned migrations have a version, a description and a checksum. The version must be unique. The description is purely
informative for you to be able to remember what each migration does. The checksum is there to detect accidental changes.
Versioned migrations are the most common type of migration. They are applied in order exactly once.
Versioned migrations are typically used for:
● Creating/altering/dropping tables/indexes/foreign keys/enums/UDTs/…
● Reference data updates
● User data corrections
Undo Migrations
From Flyway Documentation :
Undo migrations are the opposite of regular versioned migrations. An undo migration is responsible for undoing the effects of
the versioned migration with the same version. Undo migrations are optional and not required to run regular versioned
migrations.
Undo Migration seems nice but can break in practice.
Preferred way is to maintain backward compatibility between the DB and all the other versions of code.
Repeatable Migrations
From Flyway Documentation :
Repeatable migrations have a description and a checksum, but no version. Instead of being run just once, they are
(re-)applied every time their checksum changes.
They are typically used for
● (Re-)creating views/procedures/functions/packages/…
● Bulk reference data reinserts
File Naming Convention
V2__Add_new_table.sql
Prefix Separator Suffix
Version Description
U2__Add_new_table.sql
Prefix Separator Suffix
Version Description
R__Add_new_table.sql
Prefix Separator Suffix
Description
Regular Versioned Migration Undo Migration Repeatable Migration
The file name consists of the following parts:
● Prefix: V for versioned (configurable), U for undo (configurable) and R for repeatable migrations (configurable)
● Version: Version with dots or underscores separate as many parts as you like (Not for repeatable migrations)
● Separator: __ (two underscores) (configurable)
● Description: Underscores or spaces separate the words
● Suffix: .sql (configurable)
Flyway Commands
Migrate
Info
Clean
Validate
Undo
Baseline
Repair
Demo
Thank You !

More Related Content

What's hot

Embracing DevOps through database migrations with Flyway
Embracing DevOps through database migrations with FlywayEmbracing DevOps through database migrations with Flyway
Embracing DevOps through database migrations with FlywayRed Gate Software
 
Database Migrations with Gradle and Liquibase
Database Migrations with Gradle and LiquibaseDatabase Migrations with Gradle and Liquibase
Database Migrations with Gradle and LiquibaseDan Stine
 
CI/CD (DevOps) 101
CI/CD (DevOps) 101CI/CD (DevOps) 101
CI/CD (DevOps) 101Hazzim Anaya
 
SDLC- concept and models
SDLC- concept and modelsSDLC- concept and models
SDLC- concept and modelsAnjali Arora
 
Devops Devops Devops
Devops Devops DevopsDevops Devops Devops
Devops Devops DevopsKris Buytaert
 
What is Jenkins | Jenkins Tutorial for Beginners | Edureka
What is Jenkins | Jenkins Tutorial for Beginners | EdurekaWhat is Jenkins | Jenkins Tutorial for Beginners | Edureka
What is Jenkins | Jenkins Tutorial for Beginners | EdurekaEdureka!
 
CI/CD Overview
CI/CD OverviewCI/CD Overview
CI/CD OverviewAn Nguyen
 
Version Control System
Version Control SystemVersion Control System
Version Control Systemguptaanil
 
Microsoft DevOps Solution - DevOps
Microsoft DevOps Solution - DevOps  Microsoft DevOps Solution - DevOps
Microsoft DevOps Solution - DevOps Chetan Gordhan
 

What's hot (20)

Embracing DevOps through database migrations with Flyway
Embracing DevOps through database migrations with FlywayEmbracing DevOps through database migrations with Flyway
Embracing DevOps through database migrations with Flyway
 
An introduction to DevOps
An introduction to DevOpsAn introduction to DevOps
An introduction to DevOps
 
Database Migrations with Gradle and Liquibase
Database Migrations with Gradle and LiquibaseDatabase Migrations with Gradle and Liquibase
Database Migrations with Gradle and Liquibase
 
CI/CD (DevOps) 101
CI/CD (DevOps) 101CI/CD (DevOps) 101
CI/CD (DevOps) 101
 
Devops insights
Devops insightsDevops insights
Devops insights
 
Jenkins presentation
Jenkins presentationJenkins presentation
Jenkins presentation
 
SDLC- concept and models
SDLC- concept and modelsSDLC- concept and models
SDLC- concept and models
 
Continuous Integration vs Continuous Delivery vs Continuous Deployment
Continuous Integration vs Continuous Delivery vs Continuous Deployment Continuous Integration vs Continuous Delivery vs Continuous Deployment
Continuous Integration vs Continuous Delivery vs Continuous Deployment
 
Devops Devops Devops
Devops Devops DevopsDevops Devops Devops
Devops Devops Devops
 
LiquiBase
LiquiBaseLiquiBase
LiquiBase
 
What is Jenkins | Jenkins Tutorial for Beginners | Edureka
What is Jenkins | Jenkins Tutorial for Beginners | EdurekaWhat is Jenkins | Jenkins Tutorial for Beginners | Edureka
What is Jenkins | Jenkins Tutorial for Beginners | Edureka
 
CI/CD Overview
CI/CD OverviewCI/CD Overview
CI/CD Overview
 
Version Control System
Version Control SystemVersion Control System
Version Control System
 
Jenkins Overview
Jenkins OverviewJenkins Overview
Jenkins Overview
 
Jenkins CI presentation
Jenkins CI presentationJenkins CI presentation
Jenkins CI presentation
 
Liquibase case study
Liquibase case studyLiquibase case study
Liquibase case study
 
Jenkins Tutorial.pdf
Jenkins Tutorial.pdfJenkins Tutorial.pdf
Jenkins Tutorial.pdf
 
Azure DevOps
Azure DevOpsAzure DevOps
Azure DevOps
 
Prometheus monitoring
Prometheus monitoringPrometheus monitoring
Prometheus monitoring
 
Microsoft DevOps Solution - DevOps
Microsoft DevOps Solution - DevOps  Microsoft DevOps Solution - DevOps
Microsoft DevOps Solution - DevOps
 

Similar to Flyway Database Version Management

Introduction To Liquibase
Introduction To Liquibase Introduction To Liquibase
Introduction To Liquibase Knoldus Inc.
 
Relational Database CI/CD
Relational Database CI/CDRelational Database CI/CD
Relational Database CI/CDJasmin Fluri
 
Schema migration (DB migration) with Phinx
Schema migration (DB migration) with PhinxSchema migration (DB migration) with Phinx
Schema migration (DB migration) with PhinxHadi Ariawan
 
HA SOA Application with GlusterFS
HA SOA Application with GlusterFSHA SOA Application with GlusterFS
HA SOA Application with GlusterFSzeridon
 
Third Meetup Slides Mulesoft Mexico City
Third Meetup Slides Mulesoft Mexico CityThird Meetup Slides Mulesoft Mexico City
Third Meetup Slides Mulesoft Mexico CityAlan Muñoz Ochoa
 
Version Control System - for Agile Software Project Management.
Version Control System - for Agile Software Project Management.Version Control System - for Agile Software Project Management.
Version Control System - for Agile Software Project Management.Bhavya Chawla
 
DevOps Practices in a Nutshell
DevOps Practices in a NutshellDevOps Practices in a Nutshell
DevOps Practices in a NutshellFibonalabs
 
Second Caracas MuleSoft Meetup Slides
Second Caracas MuleSoft Meetup SlidesSecond Caracas MuleSoft Meetup Slides
Second Caracas MuleSoft Meetup SlidesFernando Silva
 
Volunteering at YouSee on Technology Support
Volunteering at YouSee on Technology SupportVolunteering at YouSee on Technology Support
Volunteering at YouSee on Technology SupportYouSee
 
version control system (2).pptx
version control system (2).pptxversion control system (2).pptx
version control system (2).pptxDipanshuRaj19
 
Multi platform application deployment with urban code deploy
Multi platform application deployment with urban code deployMulti platform application deployment with urban code deploy
Multi platform application deployment with urban code deploySaranga Tripathy
 
[DevDay2018] Automate database migration using flyway framework - By Karthick...
[DevDay2018] Automate database migration using flyway framework - By Karthick...[DevDay2018] Automate database migration using flyway framework - By Karthick...
[DevDay2018] Automate database migration using flyway framework - By Karthick...DevDay.org
 
The influence of "Distributed platforms" on #devops
The influence of "Distributed platforms" on #devopsThe influence of "Distributed platforms" on #devops
The influence of "Distributed platforms" on #devopsKris Buytaert
 
Selena Deckelmann - Sane Schema Management with Alembic and SQLAlchemy @ Pos...
Selena Deckelmann - Sane Schema Management with  Alembic and SQLAlchemy @ Pos...Selena Deckelmann - Sane Schema Management with  Alembic and SQLAlchemy @ Pos...
Selena Deckelmann - Sane Schema Management with Alembic and SQLAlchemy @ Pos...PostgresOpen
 
Easy database migrations with C# and FluentMigrator
Easy database migrations with C# and FluentMigratorEasy database migrations with C# and FluentMigrator
Easy database migrations with C# and FluentMigratorSafal Mahat
 
Simplify your SAP CPI development with Figaf
Simplify your SAP CPI development with FigafSimplify your SAP CPI development with Figaf
Simplify your SAP CPI development with FigafDaniel Graversen
 
Session on evaluation of DevSecOps
Session on evaluation of DevSecOpsSession on evaluation of DevSecOps
Session on evaluation of DevSecOpsAbdullah al Mamun
 
It’s 2021. Why are we -still- rebooting for patches? A look at Live Patching.
It’s 2021. Why are we -still- rebooting for patches? A look at Live Patching.It’s 2021. Why are we -still- rebooting for patches? A look at Live Patching.
It’s 2021. Why are we -still- rebooting for patches? A look at Live Patching.All Things Open
 

Similar to Flyway Database Version Management (20)

Introduction To Liquibase
Introduction To Liquibase Introduction To Liquibase
Introduction To Liquibase
 
Scm PPT
Scm PPTScm PPT
Scm PPT
 
Relational Database CI/CD
Relational Database CI/CDRelational Database CI/CD
Relational Database CI/CD
 
Schema migration (DB migration) with Phinx
Schema migration (DB migration) with PhinxSchema migration (DB migration) with Phinx
Schema migration (DB migration) with Phinx
 
HA SOA Application with GlusterFS
HA SOA Application with GlusterFSHA SOA Application with GlusterFS
HA SOA Application with GlusterFS
 
Third Meetup Slides Mulesoft Mexico City
Third Meetup Slides Mulesoft Mexico CityThird Meetup Slides Mulesoft Mexico City
Third Meetup Slides Mulesoft Mexico City
 
SCM PPT
SCM PPTSCM PPT
SCM PPT
 
Version Control System - for Agile Software Project Management.
Version Control System - for Agile Software Project Management.Version Control System - for Agile Software Project Management.
Version Control System - for Agile Software Project Management.
 
DevOps Practices in a Nutshell
DevOps Practices in a NutshellDevOps Practices in a Nutshell
DevOps Practices in a Nutshell
 
Second Caracas MuleSoft Meetup Slides
Second Caracas MuleSoft Meetup SlidesSecond Caracas MuleSoft Meetup Slides
Second Caracas MuleSoft Meetup Slides
 
Volunteering at YouSee on Technology Support
Volunteering at YouSee on Technology SupportVolunteering at YouSee on Technology Support
Volunteering at YouSee on Technology Support
 
version control system (2).pptx
version control system (2).pptxversion control system (2).pptx
version control system (2).pptx
 
Multi platform application deployment with urban code deploy
Multi platform application deployment with urban code deployMulti platform application deployment with urban code deploy
Multi platform application deployment with urban code deploy
 
[DevDay2018] Automate database migration using flyway framework - By Karthick...
[DevDay2018] Automate database migration using flyway framework - By Karthick...[DevDay2018] Automate database migration using flyway framework - By Karthick...
[DevDay2018] Automate database migration using flyway framework - By Karthick...
 
The influence of "Distributed platforms" on #devops
The influence of "Distributed platforms" on #devopsThe influence of "Distributed platforms" on #devops
The influence of "Distributed platforms" on #devops
 
Selena Deckelmann - Sane Schema Management with Alembic and SQLAlchemy @ Pos...
Selena Deckelmann - Sane Schema Management with  Alembic and SQLAlchemy @ Pos...Selena Deckelmann - Sane Schema Management with  Alembic and SQLAlchemy @ Pos...
Selena Deckelmann - Sane Schema Management with Alembic and SQLAlchemy @ Pos...
 
Easy database migrations with C# and FluentMigrator
Easy database migrations with C# and FluentMigratorEasy database migrations with C# and FluentMigrator
Easy database migrations with C# and FluentMigrator
 
Simplify your SAP CPI development with Figaf
Simplify your SAP CPI development with FigafSimplify your SAP CPI development with Figaf
Simplify your SAP CPI development with Figaf
 
Session on evaluation of DevSecOps
Session on evaluation of DevSecOpsSession on evaluation of DevSecOps
Session on evaluation of DevSecOps
 
It’s 2021. Why are we -still- rebooting for patches? A look at Live Patching.
It’s 2021. Why are we -still- rebooting for patches? A look at Live Patching.It’s 2021. Why are we -still- rebooting for patches? A look at Live Patching.
It’s 2021. Why are we -still- rebooting for patches? A look at Live Patching.
 

More from Knoldus Inc.

Robusta -Tool Presentation (DevOps).pptx
Robusta -Tool Presentation (DevOps).pptxRobusta -Tool Presentation (DevOps).pptx
Robusta -Tool Presentation (DevOps).pptxKnoldus Inc.
 
Optimizing Kubernetes using GOLDILOCKS.pptx
Optimizing Kubernetes using GOLDILOCKS.pptxOptimizing Kubernetes using GOLDILOCKS.pptx
Optimizing Kubernetes using GOLDILOCKS.pptxKnoldus Inc.
 
Azure Function App Exception Handling.pptx
Azure Function App Exception Handling.pptxAzure Function App Exception Handling.pptx
Azure Function App Exception Handling.pptxKnoldus Inc.
 
CQRS Design Pattern Presentation (Java).pptx
CQRS Design Pattern Presentation (Java).pptxCQRS Design Pattern Presentation (Java).pptx
CQRS Design Pattern Presentation (Java).pptxKnoldus Inc.
 
ETL Observability: Azure to Snowflake Presentation
ETL Observability: Azure to Snowflake PresentationETL Observability: Azure to Snowflake Presentation
ETL Observability: Azure to Snowflake PresentationKnoldus Inc.
 
Scripting with K6 - Beyond the Basics Presentation
Scripting with K6 - Beyond the Basics PresentationScripting with K6 - Beyond the Basics Presentation
Scripting with K6 - Beyond the Basics PresentationKnoldus Inc.
 
Getting started with dotnet core Web APIs
Getting started with dotnet core Web APIsGetting started with dotnet core Web APIs
Getting started with dotnet core Web APIsKnoldus Inc.
 
Introduction To Rust part II Presentation
Introduction To Rust part II PresentationIntroduction To Rust part II Presentation
Introduction To Rust part II PresentationKnoldus Inc.
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
Configuring Workflows & Validators in JIRA
Configuring Workflows & Validators in JIRAConfiguring Workflows & Validators in JIRA
Configuring Workflows & Validators in JIRAKnoldus Inc.
 
Advanced Python (with dependency injection and hydra configuration packages)
Advanced Python (with dependency injection and hydra configuration packages)Advanced Python (with dependency injection and hydra configuration packages)
Advanced Python (with dependency injection and hydra configuration packages)Knoldus Inc.
 
Azure Databricks (For Data Analytics).pptx
Azure Databricks (For Data Analytics).pptxAzure Databricks (For Data Analytics).pptx
Azure Databricks (For Data Analytics).pptxKnoldus Inc.
 
The Power of Dependency Injection with Dagger 2 and Kotlin
The Power of Dependency Injection with Dagger 2 and KotlinThe Power of Dependency Injection with Dagger 2 and Kotlin
The Power of Dependency Injection with Dagger 2 and KotlinKnoldus Inc.
 
Data Engineering with Databricks Presentation
Data Engineering with Databricks PresentationData Engineering with Databricks Presentation
Data Engineering with Databricks PresentationKnoldus Inc.
 
Databricks for MLOps Presentation (AI/ML)
Databricks for MLOps Presentation (AI/ML)Databricks for MLOps Presentation (AI/ML)
Databricks for MLOps Presentation (AI/ML)Knoldus Inc.
 
NoOps - (Automate Ops) Presentation.pptx
NoOps - (Automate Ops) Presentation.pptxNoOps - (Automate Ops) Presentation.pptx
NoOps - (Automate Ops) Presentation.pptxKnoldus Inc.
 
Mastering Distributed Performance Testing
Mastering Distributed Performance TestingMastering Distributed Performance Testing
Mastering Distributed Performance TestingKnoldus Inc.
 
MLops on Vertex AI Presentation (AI/ML).pptx
MLops on Vertex AI Presentation (AI/ML).pptxMLops on Vertex AI Presentation (AI/ML).pptx
MLops on Vertex AI Presentation (AI/ML).pptxKnoldus Inc.
 
Introduction to Ansible Tower Presentation
Introduction to Ansible Tower PresentationIntroduction to Ansible Tower Presentation
Introduction to Ansible Tower PresentationKnoldus Inc.
 
CQRS with dot net services presentation.
CQRS with dot net services presentation.CQRS with dot net services presentation.
CQRS with dot net services presentation.Knoldus Inc.
 

More from Knoldus Inc. (20)

Robusta -Tool Presentation (DevOps).pptx
Robusta -Tool Presentation (DevOps).pptxRobusta -Tool Presentation (DevOps).pptx
Robusta -Tool Presentation (DevOps).pptx
 
Optimizing Kubernetes using GOLDILOCKS.pptx
Optimizing Kubernetes using GOLDILOCKS.pptxOptimizing Kubernetes using GOLDILOCKS.pptx
Optimizing Kubernetes using GOLDILOCKS.pptx
 
Azure Function App Exception Handling.pptx
Azure Function App Exception Handling.pptxAzure Function App Exception Handling.pptx
Azure Function App Exception Handling.pptx
 
CQRS Design Pattern Presentation (Java).pptx
CQRS Design Pattern Presentation (Java).pptxCQRS Design Pattern Presentation (Java).pptx
CQRS Design Pattern Presentation (Java).pptx
 
ETL Observability: Azure to Snowflake Presentation
ETL Observability: Azure to Snowflake PresentationETL Observability: Azure to Snowflake Presentation
ETL Observability: Azure to Snowflake Presentation
 
Scripting with K6 - Beyond the Basics Presentation
Scripting with K6 - Beyond the Basics PresentationScripting with K6 - Beyond the Basics Presentation
Scripting with K6 - Beyond the Basics Presentation
 
Getting started with dotnet core Web APIs
Getting started with dotnet core Web APIsGetting started with dotnet core Web APIs
Getting started with dotnet core Web APIs
 
Introduction To Rust part II Presentation
Introduction To Rust part II PresentationIntroduction To Rust part II Presentation
Introduction To Rust part II Presentation
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Configuring Workflows & Validators in JIRA
Configuring Workflows & Validators in JIRAConfiguring Workflows & Validators in JIRA
Configuring Workflows & Validators in JIRA
 
Advanced Python (with dependency injection and hydra configuration packages)
Advanced Python (with dependency injection and hydra configuration packages)Advanced Python (with dependency injection and hydra configuration packages)
Advanced Python (with dependency injection and hydra configuration packages)
 
Azure Databricks (For Data Analytics).pptx
Azure Databricks (For Data Analytics).pptxAzure Databricks (For Data Analytics).pptx
Azure Databricks (For Data Analytics).pptx
 
The Power of Dependency Injection with Dagger 2 and Kotlin
The Power of Dependency Injection with Dagger 2 and KotlinThe Power of Dependency Injection with Dagger 2 and Kotlin
The Power of Dependency Injection with Dagger 2 and Kotlin
 
Data Engineering with Databricks Presentation
Data Engineering with Databricks PresentationData Engineering with Databricks Presentation
Data Engineering with Databricks Presentation
 
Databricks for MLOps Presentation (AI/ML)
Databricks for MLOps Presentation (AI/ML)Databricks for MLOps Presentation (AI/ML)
Databricks for MLOps Presentation (AI/ML)
 
NoOps - (Automate Ops) Presentation.pptx
NoOps - (Automate Ops) Presentation.pptxNoOps - (Automate Ops) Presentation.pptx
NoOps - (Automate Ops) Presentation.pptx
 
Mastering Distributed Performance Testing
Mastering Distributed Performance TestingMastering Distributed Performance Testing
Mastering Distributed Performance Testing
 
MLops on Vertex AI Presentation (AI/ML).pptx
MLops on Vertex AI Presentation (AI/ML).pptxMLops on Vertex AI Presentation (AI/ML).pptx
MLops on Vertex AI Presentation (AI/ML).pptx
 
Introduction to Ansible Tower Presentation
Introduction to Ansible Tower PresentationIntroduction to Ansible Tower Presentation
Introduction to Ansible Tower Presentation
 
CQRS with dot net services presentation.
CQRS with dot net services presentation.CQRS with dot net services presentation.
CQRS with dot net services presentation.
 

Recently uploaded

Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 

Recently uploaded (20)

Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 

Flyway Database Version Management

  • 1. Presented By: Muskan Gupta Flyway : A Database Version Management Tool
  • 2. Lack of etiquette and manners is a huge turn off. KnolX Etiquettes Punctuality Respect Knolx session timings, you are requested not to join sessions after a 5 minutes threshold post the session start time. Feedback Make sure to submit a constructive feedback for all sessions as it is very helpful for the presenter. Silent Mode Keep your screen on mute if there is nothing to say.
  • 3. Our Agenda 01 Naive approach to handle Database 02 What is Database Version Control? 03 Importance of Version Control 04 Flyway: Database Version Control Tool 05 How Flyway Works? 06 Flyway Migrations 07 Flyway Commands 08 Demo
  • 4. Naive approach to handle Database XYZ Database XYZ Project XYZ Database XYZ Project XYZ Database XYZ Project XYZ Database XYZ Project XYZ Database XYZ Project XYZ Database XYZ Project XYZ Database XYZ Project XYZ Database XYZ Project XYZ Database XYZ Project XYZ Database XYZ Project XYZ Database XYZ Project XYZ Database XYZ Project Multiple Users Multiple Environments XYZ Databse XYZ Project
  • 5. Naive approach to handle Database Problems with Naive approach - ● What state is the database in on this machine? ● Has this script already been applied or not? ● Has the quick fix in production been applied in test afterwards? ● How do you set up a new database instance?
  • 6. What is Database Version Control? ● Database version control is similar to application version control. ● Keep the track of all the changes done to your database by all the team members. ● We need to store the Data Definition Language (DDL) code for a database in a version control system. ● Also it should maintain a history of all the changes done to the database.
  • 7. Importance of Version Control 03 04 Better Collaboration Between Team Members Efficient and Scalable Deployments 01 02 Single Source of Truth Increased Visibility 05 06 Database Rollbacks Database Automation
  • 8. Flyway : Database Version Control Tool ● Version Control for your Database ● An Open Source tool for migration based database version control. ● It has a community as well as a teams version. ● Community Support is available for free version and Redgate Support is available for paid version. ● It provides multiple ways to use flyway. It has : ○ Command Line Client ○ API ○ Maven ○ Gradle
  • 9. How Flyway Works? Empty Database Flyway Migrations
  • 10. How Flyway Works? 1. Try to locate schema history table. A schema history table is a table that flyway uses to maintain the version. By having a look at the table flyway decides which migrations need to be applied and which migrations have already been implemented. 2. If schema history table is not found flyway will create the table in primary/default schema. 3. After creation of table, it will try to locate all the migrations at the migration location provided in configuration. 4. According to the version it will apply the migrations one by one in incremental fashion and update schema history table accordingly.
  • 11. Flyway Migrations In terms of Flyway all the changes to the database are temed as Migrations. Migrations are of 2 types : ● Versioned migration ○ Regular Versioned Migration ○ Undo Migration ● Repeatable migrationf Migrations can be written both in SQL and in Java. Flyway automatically discovers migrations on the filesystem and on the Java classpath. Within a single migration run, versioned migrations are applied first as per their version and repeatable migrations are always applied last, after all versioned migrations have been executed. Repeatable migrations are applied in the order of their description.
  • 12. Versioned Migrations From Flyway Documentation : Versioned migrations have a version, a description and a checksum. The version must be unique. The description is purely informative for you to be able to remember what each migration does. The checksum is there to detect accidental changes. Versioned migrations are the most common type of migration. They are applied in order exactly once. Versioned migrations are typically used for: ● Creating/altering/dropping tables/indexes/foreign keys/enums/UDTs/… ● Reference data updates ● User data corrections
  • 13. Undo Migrations From Flyway Documentation : Undo migrations are the opposite of regular versioned migrations. An undo migration is responsible for undoing the effects of the versioned migration with the same version. Undo migrations are optional and not required to run regular versioned migrations. Undo Migration seems nice but can break in practice. Preferred way is to maintain backward compatibility between the DB and all the other versions of code.
  • 14. Repeatable Migrations From Flyway Documentation : Repeatable migrations have a description and a checksum, but no version. Instead of being run just once, they are (re-)applied every time their checksum changes. They are typically used for ● (Re-)creating views/procedures/functions/packages/… ● Bulk reference data reinserts
  • 15. File Naming Convention V2__Add_new_table.sql Prefix Separator Suffix Version Description U2__Add_new_table.sql Prefix Separator Suffix Version Description R__Add_new_table.sql Prefix Separator Suffix Description Regular Versioned Migration Undo Migration Repeatable Migration The file name consists of the following parts: ● Prefix: V for versioned (configurable), U for undo (configurable) and R for repeatable migrations (configurable) ● Version: Version with dots or underscores separate as many parts as you like (Not for repeatable migrations) ● Separator: __ (two underscores) (configurable) ● Description: Underscores or spaces separate the words ● Suffix: .sql (configurable)
  • 17. Demo