Source control for your database in five steps Hello! I am Deon - - PowerPoint PPT Presentation
Source control for your database in five steps Hello! I am Deon - - PowerPoint PPT Presentation
Source control for your database in five steps Hello! I am Deon Taljaard Application Developer Agenda Source control for databases? What is Liquibase? What are the benefits of using Liquibase? Demo Questions? Source
I am Deon Taljaard
Application Developer
Hello!
Agenda
◉ Source control for databases? ◉ What is Liquibase? ◉ What are the benefits of using Liquibase? ◉ Demo ◉ Questions?
Source control for databases? 1
We have all used source control software for our code Source control for databases? What about our databases?
◉ Manual approach ◉ Version SQL scripts ◉ Homegrown tool
Consider the following scenarios: Source control for databases?
◉ A client has logged a defect and you need to restore your database to a state that matches a specific version of the code base the defect resides in ◉ What happens to the data in the database if the schema changes
Problems with manually addressing scenarios: Source control for databases?
◉ Inconsistent application of changes ◉ Ineffective mechanisms for managing changes ◉ Changes may not have been communicated to the team ◉ Out of sync database between environments
Source control for databases?
There are tools available to cater for scenarios like these and many more Source control for databases? And more...
Liquibase is NOT the only tool for doing this Source control for databases?
◉ If anything, I hope that at the end of the presentation all of us may realise the value and importance of employing such a technology in our software projects - and that you consider which tool will work for you and your projects.
What is Liquibase and what is it used for? 2
What is Liquibase?
◉ Liquibase is an open source database-independent library for tracking, managing and applying database schema changes ◉ It has an extensive feature set, yet it’s simple enough to get started with
Core concepts for working with Liquibase: What is Liquibase?
◉ Changeset ◉ Changelog ◉ Databasechangelog ◉ Databasechangeloglock
What are the benefits of using Liquibase? 3
From the Liquibase site: What are the benefits of using Liquibase?
◉ Supports code branching and merging ◉ Supports multiple developers ◉ Supports multiple database types ◉ Supports XML, YAML, JSON and SQL formats ◉ Generate Database "diffs"
Personal additions: What are the benefits of using Liquibase?
◉ It keeps all the changes to the db in one place ◉ It abstracts schema changes into a model, which is easily understandable ◉ All the changes do not have to be kept in one change log file - use sub changelogs and include in master changelog
Personal additions: What are the benefits of using Liquibase?
◉ Makes applying DB changes quick, easy and safe ◉ We can integrate Liquibase into our build management to deal with database changes. So applying LiquiBase is just a click or two. ◉ The learning curve is steep, however first results are achieved quick
Demo 4
Two scenarios Demo
◉ Employing Liquibase from the inception of a project ◉ Adding Liquibase to an existing/legacy project
Employing Liquibase from the inception of a project Demo
Add Liquibase Add master changelog Add changeset Liquibase update Commit changelog
Demo
- 1. Add Liquibase
Demo
- 2. Add master changelog
Demo
- 3. Add changeset
Demo
- 4. Run Liquibase update
- 5. Commit changelog
Adding Liquibase to an existing/legacy project Demo
Add Liquibase Generate changelog Commit changelog Add master changelog
Demo
- 1. Add Liquibase
Demo
- 2. Add master changelog
Demo
- 3. Run Liquibase generateChangeLog (with
changelogSync)
- 4. Commit changelog(s)
Any questions?
Thanks!
Credits
Special thanks to all the people who made and released these awesome resources for free: ◉ Presentation template by SlidesCarnival