TUGA IT 2016
LISBON, PORTUGAL
THANK YOU TO OUR SPONSORS
THANK YOU TO OUR TEAM
ANDRÉ BATISTA ANDRÉ MELANCIA ANDRÉ VALA ANTÓNIO LOURENÇO BRUNO LOPES CLÁUDIO SILVA
NIKO NEUGEBAUER
RUI REISRICARDO CABRAL
NUNO CANCELO PAULO MATOS PEDRO SIMÕES
SANDRA MORGADO SANDRO PEREIRARUI BASTOS
NUNO ÁRIAS SILVA
ROAD TO DATABASE AUTOMATION Eduardo Piairo
Database Source Control
DATABASE SOURCE CONTROL– MIGRATIONS VS STATE
• Eduardo Piairo
• @ Celfinet
• DBA
• DevOps
About me
@EdPiairo
https://pt.linkedin.com/in/jesuspiairo
eduardopiairo@outlook.com
http://www.eduardopiairo.com/
DATABASE SOURCE CONTROL– MIGRATIONS VS STATE
Overview
Source
Control
Continuous
Integration
Continuous
Delivery
Database
+
Application
DATABASE SOURCE CONTROL– MIGRATIONS VS STATE
What’s so special about databases?
Overview
DLM – Database Lifecycle Management
• Data management and data migration
• Data monitoring
• Data recovery
ROAD TO DATABASE AUTOMATION – DATABASE SOURCE CONTROL
Motivation
• Database are out of pace with application development
• Need of synchronization between development and DBA teams
• No traceability of database changes (changes history)
• What changed? Why? When? Who?
• Manual databases processes prevent the CI and CD utilization in their full extent
• Database release process is manual
• Time consuming and error prone
• Releases are less frequent and risky
ROAD TO DATABASE AUTOMATION – DATABASE SOURCE CONTROL
Motivation
• Tests are manual or do not exists
• Bugs in production environment
• Database related bugs are only discovered after deployment to production
• Fixes and hotfixes have time cost, what can lead to delay a release
• Inability to roll back to the previous version of a database
• Database setup time of a new environment
• Databases become a bottleneck in agile delivery processes
ROAD TO DATABASE AUTOMATION – DATABASE SOURCE CONTROL
Why database automation?
• Enable control over database development
• Keep a versioned “history” of database sates
• Increase release frequency though repeatability of processes
• Greater predictability over releases
• Efficiency by eliminating the repetition of a range of manual activities
• Reduce time spent fixing bugs
• More control, less exposure to error
ROAD TO DATABASE AUTOMATION – DATABASE SOURCE CONTROL
Why database automation?
• Faster speed of response to change
• Automated deployment of smaller units of change
• Remove/reduce human intervention in the release process
• The build step is automatic triggered by a “push” into source control repository
• The deploy step is automatic triggered by a successfully build process
• Greater reliability of the release process
• Providing a series of automated test stages prior to deployment
• Maintain an agile development environment
ROAD TO DATABASE AUTOMATION – DATABASE SOURCE CONTROL
Why database source control?
• First step for database automation
• Share code (SQL scripts)
• Keep history of each change
• Your best comunication system
• Enforce standards
DATABASE SOURCE CONTROL– MIGRATIONS VS STATE
Migrations-based approach vs State-based approach
• Fundamental resource: SQL Script
• State based solutions
• Script represents the current database state
• Your source of truth is how the database should be
• Migrations based solutions
• Script represents a migration
• Migration represents how to transition to the next database version
• Your source of truth is how the database should change
DATABASE SOURCE CONTROL– MIGRATIONS VS STATE
Flyway
• Flyway – “Database migrations made easy”
• http://flywaydb.org/
• Open source database migration tool
• My reasons for adopting Flyway (command-line)
• Simplicity: easy to setup, no need to install
• Zero dependencies (java + jdbc)
• Scripts are written in SQL
ROAD TO DATABASE AUTOMATION – DATABASE SOURCE CONTROL
Demo
DATABASE SOURCE CONTROL– MIGRATIONS VS STATE
Flyway – Why database migrations?
• Migrations
• Recreate a database from scratch
• Make it clear at all time what state a database is in
• Migrate in a deterministic way from your current version of the database to a newer one
DATABASE SOURCE CONTROL– MIGRATIONS VS STATE
Flyway – How it works?
• Flyway commands
• Migrate, clean info, validate, baseline repair
• Metadata table
• Used to track the state of the database
• Default name: “schema_version”
• If the database is empty, flyway won’t find it and will create it
• Flyway scans the migrations directory and check migrations against the metadata table
• Migrations are sorted based on their version number and applied in order
ROAD TO DATABASE AUTOMATION – DATABASE SOURCE CONTROL
Version Control System – The system
• Two components
• Database scripts repository
• Flyway – database migrations
Example:
V20160220.1100__Create_TB_MyTable.sql
• Rule 1: Script version (timestamp)
• Rule 2: Operation type
• Rule 3: Object type
• Rule 4: Object name
ROAD TO DATABASE AUTOMATION – DATABASE SOURCE CONTROL
Demo
ROAD TO DATABASE AUTOMATION – DATABASE SOURCE CONTROL
Version Control System – Challenges
• Challenge 1 – manage multiple branches
• In other words, is necessary to mange merge/interests conflicts
• The default branch is the main/master branch and all the merges for this branch must be done with caution
• Challenge 2 – script expiration date
• Should the migration script have expiration date?
• Sometimes, in the next day the migration script makes no sense anymore
ROAD TO DATABASE AUTOMATION – DATABASE SOURCE CONTROL
Version Control System – Challenges
• Challenge 3 – migration scripts stack
• How can I manage the dependencies between different databases?
• And how about dependencies between applications/components
• Challenge 4 – developer sandbox
• How to supply a disposable development environment where the database is included?
ROAD TO DATABASE AUTOMATION – DATABASE SOURCE CONTROL
What’s next?
DATABASE SOURCE CONTROL– MIGRATIONS VS STATE
Q&A
@EdPiairo
https://pt.linkedin.com/in/jesuspiairo
eduardopiairo@outlook.com
http://www.eduardopiairo.com/

More Related Content

PDF
DbOps, DevOps and Ops
PDF
Road to database automation: database source control
PDF
Road to database automation - Database source control
PDF
Delivering changes for applications and databases
PDF
Database Source Control: Migrations vs State
PPTX
Database Source Control: Migrations vs State
PDF
Delivering Changes for Applications and Databases
PDF
Road to database automation: database source control
DbOps, DevOps and Ops
Road to database automation: database source control
Road to database automation - Database source control
Delivering changes for applications and databases
Database Source Control: Migrations vs State
Database Source Control: Migrations vs State
Delivering Changes for Applications and Databases
Road to database automation: database source control

What's hot (20)

PPTX
Database Change Management as a Service
PPTX
Bringing DevOps to the Database
PPTX
Your API is Bad and You Should Feel Bad
PPTX
Performance metrics for a social network
PDF
Fashiolista
PPTX
Cross-platform interaction
PDF
Delivering changes for databases and applications
PPTX
SenchaCon 2016: Oracle Forms Modernisation - Owen Pagan
PPTX
DevOps+Data: Working with Source Control
PDF
Delivering changes for applications and databases @ Azure
PPTX
Building Ext JS Using HATEOAS - Jeff Stano
PPTX
Building your bi system-HadoopCon Taiwan 2015
PDF
Sql developer - Powerful Free tool for Developers and DBA's
PPTX
Evolutionary database design
PPTX
Geek Sync | Extended Events: What Are They and How Do I Use Them?
PPT
introduction v4
PDF
Apache Kafka and API Management / API Gateway – Friends, Enemies or Frenemies...
PDF
[WSO2Con EU 2017] How a Large Organization Weighted on a WSO2 Integration Pla...
PDF
PPTX
AMIS Beyond the Horizon - High density deployments using weblogic multitenancy
Database Change Management as a Service
Bringing DevOps to the Database
Your API is Bad and You Should Feel Bad
Performance metrics for a social network
Fashiolista
Cross-platform interaction
Delivering changes for databases and applications
SenchaCon 2016: Oracle Forms Modernisation - Owen Pagan
DevOps+Data: Working with Source Control
Delivering changes for applications and databases @ Azure
Building Ext JS Using HATEOAS - Jeff Stano
Building your bi system-HadoopCon Taiwan 2015
Sql developer - Powerful Free tool for Developers and DBA's
Evolutionary database design
Geek Sync | Extended Events: What Are They and How Do I Use Them?
introduction v4
Apache Kafka and API Management / API Gateway – Friends, Enemies or Frenemies...
[WSO2Con EU 2017] How a Large Organization Weighted on a WSO2 Integration Pla...
AMIS Beyond the Horizon - High density deployments using weblogic multitenancy
Ad

Viewers also liked (20)

PPTX
Fm wtm12-v2
PPTX
opt-mem-trx
PDF
33rd degree talk: open and automatic coding conventions with walkmod
PPTX
The Challenges & Pitfalls of Database Continuous Delivery
PPTX
Challenges and best practices of database continuous delivery
PPTX
Building Solutions with Office Graph
PDF
walkmod: how it works
PDF
Patterns and Tools for Database Versioning, Migration, Data Loading and Test ...
PDF
Continuous Delivery and Zero Downtime: What your architecture needs to succeed
PDF
Database version control without pain - the PHPNW10 version
PPTX
Flyway (33rd Degree)
PDF
KYSUC - Keep Your Schema Under Control
PDF
Building Rich Domain Models
PDF
Database migration with flyway
PDF
Javaland 2016 - Flyway vs. LiquiBase - Battle der Datenbankmigrationstools
ODP
Liquibase & Flyway @ Baltic DevOps
PDF
Database Schema Evolution
PDF
Database security issues
PDF
Database migrations with Flyway and Liquibase
Fm wtm12-v2
opt-mem-trx
33rd degree talk: open and automatic coding conventions with walkmod
The Challenges & Pitfalls of Database Continuous Delivery
Challenges and best practices of database continuous delivery
Building Solutions with Office Graph
walkmod: how it works
Patterns and Tools for Database Versioning, Migration, Data Loading and Test ...
Continuous Delivery and Zero Downtime: What your architecture needs to succeed
Database version control without pain - the PHPNW10 version
Flyway (33rd Degree)
KYSUC - Keep Your Schema Under Control
Building Rich Domain Models
Database migration with flyway
Javaland 2016 - Flyway vs. LiquiBase - Battle der Datenbankmigrationstools
Liquibase & Flyway @ Baltic DevOps
Database Schema Evolution
Database security issues
Database migrations with Flyway and Liquibase
Ad

Similar to Road to database automation: database source control (20)

PDF
Operations for databases – the agile/devops journey
PDF
Operations for databases: the agile/devops journey
PDF
Deployment pipeline for databases
PDF
Deployment pipeline for databases
PDF
Deployment pipeline for Azure SQL Databases
PDF
Operations for databases – The DevOps journey
PDF
Deployment Pipeline for databases (Azure SQL Database, SQL Server)
PDF
Eduardo Piairo - Deployment pipeline for databases (Azure SQL Database, SQL S...
PPTX
Nic solution strategy
PPTX
Data Vault Automation at the Bijenkorf
PDF
Presentation cloud control enterprise manager 12c
PDF
Cloud-native Data
PDF
Cloud-Native-Data with Cornelia Davis
PPTX
Database CI/CD Pipeline
PPTX
The Path Through SharePoint Migrations
PDF
Database Source Control: Migrations vs State
PPT
Intro Duction of Database and its fundamentals .ppt
PPTX
Evolution of big data
PPT
Various Applications of Data Warehouse.ppt
PPTX
Configurando Aplicaciones para Réplicas de Lectura de SQL-Server AlwaysOn - C...
Operations for databases – the agile/devops journey
Operations for databases: the agile/devops journey
Deployment pipeline for databases
Deployment pipeline for databases
Deployment pipeline for Azure SQL Databases
Operations for databases – The DevOps journey
Deployment Pipeline for databases (Azure SQL Database, SQL Server)
Eduardo Piairo - Deployment pipeline for databases (Azure SQL Database, SQL S...
Nic solution strategy
Data Vault Automation at the Bijenkorf
Presentation cloud control enterprise manager 12c
Cloud-native Data
Cloud-Native-Data with Cornelia Davis
Database CI/CD Pipeline
The Path Through SharePoint Migrations
Database Source Control: Migrations vs State
Intro Duction of Database and its fundamentals .ppt
Evolution of big data
Various Applications of Data Warehouse.ppt
Configurando Aplicaciones para Réplicas de Lectura de SQL-Server AlwaysOn - C...

More from Eduardo Piairo (11)

PDF
ADDO 2021: Why and how to include database changes in the deployment pipeline
PDF
Adding unit tests to the database deployment pipeline
PDF
Start by changing the way of work
PDF
Adding unit tests to the database deployment pipeline
PDF
Adding unit tests with tSQLt to the database deployment pipeline
PDF
Adding unit tests with tSQLt to the database deployment pipeline
PDF
Adding unit tests with tSQLt to the database deployment pipeline
PDF
Setting a WordPress website using Azure Web Apps And Azure Database for MySQL
PDF
SQL Server 2017 CLR
PDF
SQL Server 2017 CLR
PDF
Workshop: Delivering chnages for applications and databases
ADDO 2021: Why and how to include database changes in the deployment pipeline
Adding unit tests to the database deployment pipeline
Start by changing the way of work
Adding unit tests to the database deployment pipeline
Adding unit tests with tSQLt to the database deployment pipeline
Adding unit tests with tSQLt to the database deployment pipeline
Adding unit tests with tSQLt to the database deployment pipeline
Setting a WordPress website using Azure Web Apps And Azure Database for MySQL
SQL Server 2017 CLR
SQL Server 2017 CLR
Workshop: Delivering chnages for applications and databases

Recently uploaded (20)

PDF
Top 10 Software Development Trends to Watch in 2025 🚀.pdf
PDF
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
PPTX
Monitoring Stack: Grafana, Loki & Promtail
PDF
Salesforce Agentforce AI Implementation.pdf
PPTX
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
PDF
Topaz Photo AI Crack New Download (Latest 2025)
PPTX
Oracle Fusion HCM Cloud Demo for Beginners
PPTX
GSA Content Generator Crack (2025 Latest)
PDF
Wondershare Recoverit Full Crack New Version (Latest 2025)
PDF
Types of Token_ From Utility to Security.pdf
PDF
EaseUS PDF Editor Pro 6.2.0.2 Crack with License Key 2025
PDF
Multiverse AI Review 2025: Access All TOP AI Model-Versions!
PPTX
Computer Software and OS of computer science of grade 11.pptx
PPTX
AMADEUS TRAVEL AGENT SOFTWARE | AMADEUS TICKETING SYSTEM
PDF
How AI/LLM recommend to you ? GDG meetup 16 Aug by Fariman Guliev
PPTX
WiFi Honeypot Detecscfddssdffsedfseztor.pptx
PPTX
Tech Workshop Escape Room Tech Workshop
PDF
Autodesk AutoCAD Crack Free Download 2025
PDF
How Tridens DevSecOps Ensures Compliance, Security, and Agility
PPTX
Weekly report ppt - harsh dattuprasad patel.pptx
Top 10 Software Development Trends to Watch in 2025 🚀.pdf
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
Monitoring Stack: Grafana, Loki & Promtail
Salesforce Agentforce AI Implementation.pdf
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
Topaz Photo AI Crack New Download (Latest 2025)
Oracle Fusion HCM Cloud Demo for Beginners
GSA Content Generator Crack (2025 Latest)
Wondershare Recoverit Full Crack New Version (Latest 2025)
Types of Token_ From Utility to Security.pdf
EaseUS PDF Editor Pro 6.2.0.2 Crack with License Key 2025
Multiverse AI Review 2025: Access All TOP AI Model-Versions!
Computer Software and OS of computer science of grade 11.pptx
AMADEUS TRAVEL AGENT SOFTWARE | AMADEUS TICKETING SYSTEM
How AI/LLM recommend to you ? GDG meetup 16 Aug by Fariman Guliev
WiFi Honeypot Detecscfddssdffsedfseztor.pptx
Tech Workshop Escape Room Tech Workshop
Autodesk AutoCAD Crack Free Download 2025
How Tridens DevSecOps Ensures Compliance, Security, and Agility
Weekly report ppt - harsh dattuprasad patel.pptx

Road to database automation: database source control

  • 2. THANK YOU TO OUR SPONSORS
  • 3. THANK YOU TO OUR TEAM ANDRÉ BATISTA ANDRÉ MELANCIA ANDRÉ VALA ANTÓNIO LOURENÇO BRUNO LOPES CLÁUDIO SILVA NIKO NEUGEBAUER RUI REISRICARDO CABRAL NUNO CANCELO PAULO MATOS PEDRO SIMÕES SANDRA MORGADO SANDRO PEREIRARUI BASTOS NUNO ÁRIAS SILVA
  • 4. ROAD TO DATABASE AUTOMATION Eduardo Piairo Database Source Control
  • 5. DATABASE SOURCE CONTROL– MIGRATIONS VS STATE • Eduardo Piairo • @ Celfinet • DBA • DevOps About me @EdPiairo https://pt.linkedin.com/in/jesuspiairo [email protected] http://www.eduardopiairo.com/
  • 6. DATABASE SOURCE CONTROL– MIGRATIONS VS STATE Overview Source Control Continuous Integration Continuous Delivery Database + Application
  • 7. DATABASE SOURCE CONTROL– MIGRATIONS VS STATE What’s so special about databases? Overview DLM – Database Lifecycle Management • Data management and data migration • Data monitoring • Data recovery
  • 8. ROAD TO DATABASE AUTOMATION – DATABASE SOURCE CONTROL Motivation • Database are out of pace with application development • Need of synchronization between development and DBA teams • No traceability of database changes (changes history) • What changed? Why? When? Who? • Manual databases processes prevent the CI and CD utilization in their full extent • Database release process is manual • Time consuming and error prone • Releases are less frequent and risky
  • 9. ROAD TO DATABASE AUTOMATION – DATABASE SOURCE CONTROL Motivation • Tests are manual or do not exists • Bugs in production environment • Database related bugs are only discovered after deployment to production • Fixes and hotfixes have time cost, what can lead to delay a release • Inability to roll back to the previous version of a database • Database setup time of a new environment • Databases become a bottleneck in agile delivery processes
  • 10. ROAD TO DATABASE AUTOMATION – DATABASE SOURCE CONTROL Why database automation? • Enable control over database development • Keep a versioned “history” of database sates • Increase release frequency though repeatability of processes • Greater predictability over releases • Efficiency by eliminating the repetition of a range of manual activities • Reduce time spent fixing bugs • More control, less exposure to error
  • 11. ROAD TO DATABASE AUTOMATION – DATABASE SOURCE CONTROL Why database automation? • Faster speed of response to change • Automated deployment of smaller units of change • Remove/reduce human intervention in the release process • The build step is automatic triggered by a “push” into source control repository • The deploy step is automatic triggered by a successfully build process • Greater reliability of the release process • Providing a series of automated test stages prior to deployment • Maintain an agile development environment
  • 12. ROAD TO DATABASE AUTOMATION – DATABASE SOURCE CONTROL Why database source control? • First step for database automation • Share code (SQL scripts) • Keep history of each change • Your best comunication system • Enforce standards
  • 13. DATABASE SOURCE CONTROL– MIGRATIONS VS STATE Migrations-based approach vs State-based approach • Fundamental resource: SQL Script • State based solutions • Script represents the current database state • Your source of truth is how the database should be • Migrations based solutions • Script represents a migration • Migration represents how to transition to the next database version • Your source of truth is how the database should change
  • 14. DATABASE SOURCE CONTROL– MIGRATIONS VS STATE Flyway • Flyway – “Database migrations made easy” • http://flywaydb.org/ • Open source database migration tool • My reasons for adopting Flyway (command-line) • Simplicity: easy to setup, no need to install • Zero dependencies (java + jdbc) • Scripts are written in SQL
  • 15. ROAD TO DATABASE AUTOMATION – DATABASE SOURCE CONTROL Demo
  • 16. DATABASE SOURCE CONTROL– MIGRATIONS VS STATE Flyway – Why database migrations? • Migrations • Recreate a database from scratch • Make it clear at all time what state a database is in • Migrate in a deterministic way from your current version of the database to a newer one
  • 17. DATABASE SOURCE CONTROL– MIGRATIONS VS STATE Flyway – How it works? • Flyway commands • Migrate, clean info, validate, baseline repair • Metadata table • Used to track the state of the database • Default name: “schema_version” • If the database is empty, flyway won’t find it and will create it • Flyway scans the migrations directory and check migrations against the metadata table • Migrations are sorted based on their version number and applied in order
  • 18. ROAD TO DATABASE AUTOMATION – DATABASE SOURCE CONTROL Version Control System – The system • Two components • Database scripts repository • Flyway – database migrations Example: V20160220.1100__Create_TB_MyTable.sql • Rule 1: Script version (timestamp) • Rule 2: Operation type • Rule 3: Object type • Rule 4: Object name
  • 19. ROAD TO DATABASE AUTOMATION – DATABASE SOURCE CONTROL Demo
  • 20. ROAD TO DATABASE AUTOMATION – DATABASE SOURCE CONTROL Version Control System – Challenges • Challenge 1 – manage multiple branches • In other words, is necessary to mange merge/interests conflicts • The default branch is the main/master branch and all the merges for this branch must be done with caution • Challenge 2 – script expiration date • Should the migration script have expiration date? • Sometimes, in the next day the migration script makes no sense anymore
  • 21. ROAD TO DATABASE AUTOMATION – DATABASE SOURCE CONTROL Version Control System – Challenges • Challenge 3 – migration scripts stack • How can I manage the dependencies between different databases? • And how about dependencies between applications/components • Challenge 4 – developer sandbox • How to supply a disposable development environment where the database is included?
  • 22. ROAD TO DATABASE AUTOMATION – DATABASE SOURCE CONTROL What’s next?
  • 23. DATABASE SOURCE CONTROL– MIGRATIONS VS STATE Q&A @EdPiairo https://pt.linkedin.com/in/jesuspiairo [email protected] http://www.eduardopiairo.com/