Top Banner
Flyway Database Migrations Made Easy.
20
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Mini Training Flyway

Flyway

Database Migrations Made Easy.

Page 2: Mini Training Flyway

• Objective : database state management

• State ?

– A list of changesets (table, sp, func, db, …)

• How do we know the state of a database at a « t » moment ?

Database migration ?

Page 3: Mini Training Flyway

Database migration ?

State 1 State 2

Page 4: Mini Training Flyway

Database migration : versioning

Version

15.12.4

Version

15.12.15

Page 5: Mini Training Flyway

• Database migration Tools

– In JAVA

– Command line / API

– Use versioning

– Very light

• Work with a list of SQL migration scripts

– Schema update

– Data update

Flyway: http://flywaydb.org/

Page 6: Mini Training Flyway

Flyway – How it works ?

Database

Current version

=> 2.0.1

=> Migrate 2.0.1

Get scripts Migrate

Page 7: Mini Training Flyway

• The flyway table : « schema_version »

Flyway – Database version

Page 8: Mini Training Flyway

• 5 actions

– Migrate

– Clean

– Info

– Validate

– Baseline

Flyway - Actions

Page 9: Mini Training Flyway

Flyway - Migrate

Page 10: Mini Training Flyway

Flyway - Clean

Page 11: Mini Training Flyway

Flyway - Info

Page 12: Mini Training Flyway

Flyway - Validate

Page 13: Mini Training Flyway

Flyway - Baseline

Page 14: Mini Training Flyway

Demo

Page 15: Mini Training Flyway

Benefits

• Work with just a list of migration scripts

• Automatically find which scripts to execute to update the database to a specific version

• Show the next scripts to apply from the current version

• Easy handle of backward compatibility and scheduled obsolescence

Page 16: Mini Training Flyway

Disadvantages

• Java : hard to integrate in a custom .NET application

• Scripts migration error handling is very light

Page 17: Mini Training Flyway

17

Page 18: Mini Training Flyway

Find out more• On https://techblog.betclicgroup.com/

Page 19: Mini Training Flyway

About Us• Betclic Everest Group, one of the world leaders in online

gaming, has a unique portfolio comprising variouscomplementary international brands: Betclic, EverestPoker/Casino, Bet-at-home, Expekt, Imperial Casino, Monte-Carlo Casino…

• Through our brands, Betclic Everest Group places expertise,technological know-how and security at the heart of ourstrategy to deliver an on-line gaming offer attuned to thepassion of our players. We want our brands to be easy to usefor every gamer around the world. We’re building ourcompany to make that happen.

• Active in 100 countries with more than 12 million customersworldwide, the Group is committed to promoting secure andresponsible gaming and is a member of several internationalprofessional associations including the EGBA (EuropeanGaming and Betting Association) and the ESSA (EuropeanSports Security Association).

Page 20: Mini Training Flyway

We want our Sports betting, Poker, Horse racing andCasino & Games brands to be easy to use for everygamer around the world. Code with us to make thathappen.

Look at all the challenges we offer HERE

Check our Employer Page

Follow us on LinkedIn

WE’RE HIRING !