SlideShare a Scribd company logo
1 of 35
Download to read offline
Delivering changes for
applications and databases
“The beginning of a beautiful friendship”
Eduardo Piairo
Miguel Alho
Delivering changes for applications and databases
@EdPiairo
https://pt.linkedin.com/in/jesuspiairo
eduardopiairo@outlook.com
http://www.eduardopiairo.com/
Eduardo Piairo, DBA & DevOps @ Celfinet
Delivering changes for applications and databases
@MytyMyky
https://pt.linkedin.com/in/miguelalho-982331
alho@miguelalho.com
http://www.miguelalho.pt/
Miguel Alho, Software Engineer @ Faro Europe
@DevOpsPorto
Is Coming
Delivering changes for applications and databases
Source
Control
Continuous
Integration
Continuous
Delivery
Database
+
Application
What’s so special about the database?
What’s so special about the database?
DLM – Database Lifecycle Management
Data management and data migration
Data monitoring
Data recovery
Typical problems we want to fix
• Databases are out of pace with application development
• Lack of traceability of database changes (changes history)
• Manual databases processes prevent the CI and CD utilization
• Lack of testability
• Database setup time for new environments
• Bugs in production
Typical problems we want to fix
Databases becoming a
bottleneck in an agile
delivery process
Typical problems we want to fix
Databases becoming an
easy target to blame
Why database automation?
• Enable control over database development
• Increase speed of response to change
• Keep a versioned “history” of database states and changes
• Reliability of the release process
• Increase release frequency though repeatability of processes
• Reduce time spent fixing bugs - automated tests
• Remove/reduce human intervention in the release process
Why database automation?
Fearless database changes
1st step: Source Control
• First step in your database deployment pipeline
• Traceability through change history
• SQL as documentation
• Shared code-base and shared process
• Enforceable standards to reduce conflicts
1st Step: Source Control
Fundamental resource:
SQL Script
Migrations-based approach vs State-based approach
• 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
Flyway
• Flyway – “Database Migrations made Easy”
http://flywaydb.org/
• Open source database migration tool
• Flyway command-line enabled
Simplicity: easy to setup, no need to install
Zero dependencies (java + jdbc)
Scripts are written in SQL
Flyway – How does it work?
• Flyway commands:
• migrate, clean, info, validate, baseline, repair
• Metadata table:
• Used to track the state of the database
• 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
Version Control System
Two components:
Database scripts repository
Flyway – database migrations
Rule 1: Script version (timestamp)
Rule 2: Operation type
Rule 3: Object type
Rule 4: Object name
Example: V20160728.1100__Create_TB_MyTable.sql
Demo
How about applications?
It takes two to tango
Database and Application change alignment
● Database schemas should evolve along with application evolution
○ deploy app => deploy changes / migrations
● (Integration) Test app and db changes together
○ should pass tests while developing,
○ should pass tests while promoting to new environments
● Ideally, one application per database
● Pipeline deployment only!
Integration test at the database layer
● Use TDD techniques
● Limit database integration tests
to data layer
○ faster tests!
○ validate sql and mappings
● Always test with the latest
schema
DatabaseApplication
DatabaseApplication
Demo
https://github.com/MiguelAlho/Purchases-DbMigration-sample
What we just saw
Database and Application change alignment
Fearless database changes
Challenges
• Challenge #1: managing multiple branches
• Manage merge conflicts
• The default branch is the main/master
branch and all the merges for this branch
must be done with caution
Challenges
• Challenge #2: Script expiration date
• Should the migration script have an
expiration date?
• Sometimes, in the next day, the migration
script no longer makes sense
Challenges
• Challenge #3: migration scripts stack
• How can I manage the dependencies
between different databases?
Challenges
• Challenge #4: developer sandbox
• How to supply a disposable development
environment where the database is
included?
What’s Next?
Links
● https://github.com/MiguelAlho/Purchases-DbMigration-sample
https://flywaydb.org/
● http://dbup.github.io/
● http://www.red-gate.com/products/sql-development/sql-compare/
● https://octopus.com/
○ http://docs.octopusdeploy.com/display/OD/Deploying+ASP.NET+Core+Web+Applications
● https://www.visualstudio.com/
●
Reading material
Delivering changes for applications and databases
@EdPiairo
https://pt.linkedin.com/in/jesuspiairo
eduardopiairo@outlook.com
http://www.eduardopiairo.com/
@MytyMyky
https://pt.linkedin.com/in/miguelalho-982331
alho@miguelalho.com
http://www.miguelalho.pt/

More Related Content

What's hot

Your API is Bad and You Should Feel Bad
Your API is Bad and You Should Feel BadYour API is Bad and You Should Feel Bad
Your API is Bad and You Should Feel BadAmanda Folson
 
Database ingest with Apache NiFi and MiNiFi
Database ingest with Apache NiFi and MiNiFiDatabase ingest with Apache NiFi and MiNiFi
Database ingest with Apache NiFi and MiNiFiLucian Neghina
 
Evolutionary database design
Evolutionary database designEvolutionary database design
Evolutionary database designSalehein Syed
 
Geek Sync | Extended Events: What Are They and How Do I Use Them?
Geek Sync | Extended Events: What Are They and How Do I Use Them?Geek Sync | Extended Events: What Are They and How Do I Use Them?
Geek Sync | Extended Events: What Are They and How Do I Use Them?IDERA Software
 
Cross-platform interaction
Cross-platform interactionCross-platform interaction
Cross-platform interactionOleksii Duhno
 
DMann-SQLDeveloper4Reporting
DMann-SQLDeveloper4ReportingDMann-SQLDeveloper4Reporting
DMann-SQLDeveloper4ReportingDavid Mann
 
Cycling for noobs
Cycling for noobsCycling for noobs
Cycling for noobsSteve Lee
 
Performance metrics for a social network
Performance metrics for a social networkPerformance metrics for a social network
Performance metrics for a social networkThierry Schellenbach
 
Joe witt may2015_kafka_nyc_apachenifi-overview
Joe witt may2015_kafka_nyc_apachenifi-overviewJoe witt may2015_kafka_nyc_apachenifi-overview
Joe witt may2015_kafka_nyc_apachenifi-overviewJoseph Witt
 
Data ingestion and distribution with apache NiFi
Data ingestion and distribution with apache NiFiData ingestion and distribution with apache NiFi
Data ingestion and distribution with apache NiFiLev Brailovskiy
 
Backing Library Operations with Open Source Applications
Backing Library Operations with Open Source ApplicationsBacking Library Operations with Open Source Applications
Backing Library Operations with Open Source ApplicationsMyka Kennedy Stephens
 
Managing Descriptive Metadata with Open XML...For Now
Managing Descriptive Metadata with Open XML...For NowManaging Descriptive Metadata with Open XML...For Now
Managing Descriptive Metadata with Open XML...For NowGregory Wiedeman
 
Managing Exchange 2016 - Paul Robichaux
Managing Exchange 2016 - Paul RobichauxManaging Exchange 2016 - Paul Robichaux
Managing Exchange 2016 - Paul RobichauxSummit 7 Systems
 
Nov 2014 webinar Making The Transition From Ftp
Nov 2014 webinar Making The Transition From FtpNov 2014 webinar Making The Transition From Ftp
Nov 2014 webinar Making The Transition From FtpFileCatalyst
 
LSC@LDAPCon 2011
LSC@LDAPCon 2011LSC@LDAPCon 2011
LSC@LDAPCon 2011sbahloul
 

What's hot (20)

Your API is Bad and You Should Feel Bad
Your API is Bad and You Should Feel BadYour API is Bad and You Should Feel Bad
Your API is Bad and You Should Feel Bad
 
Plug saiku
Plug   saikuPlug   saiku
Plug saiku
 
Database ingest with Apache NiFi and MiNiFi
Database ingest with Apache NiFi and MiNiFiDatabase ingest with Apache NiFi and MiNiFi
Database ingest with Apache NiFi and MiNiFi
 
Evolutionary database design
Evolutionary database designEvolutionary database design
Evolutionary database design
 
Linq
LinqLinq
Linq
 
Flux and React.js
Flux and React.jsFlux and React.js
Flux and React.js
 
Geek Sync | Extended Events: What Are They and How Do I Use Them?
Geek Sync | Extended Events: What Are They and How Do I Use Them?Geek Sync | Extended Events: What Are They and How Do I Use Them?
Geek Sync | Extended Events: What Are They and How Do I Use Them?
 
Cross-platform interaction
Cross-platform interactionCross-platform interaction
Cross-platform interaction
 
DMann-SQLDeveloper4Reporting
DMann-SQLDeveloper4ReportingDMann-SQLDeveloper4Reporting
DMann-SQLDeveloper4Reporting
 
Cycling for noobs
Cycling for noobsCycling for noobs
Cycling for noobs
 
Performance metrics for a social network
Performance metrics for a social networkPerformance metrics for a social network
Performance metrics for a social network
 
Fashiolista
FashiolistaFashiolista
Fashiolista
 
Joe witt may2015_kafka_nyc_apachenifi-overview
Joe witt may2015_kafka_nyc_apachenifi-overviewJoe witt may2015_kafka_nyc_apachenifi-overview
Joe witt may2015_kafka_nyc_apachenifi-overview
 
Data ingestion and distribution with apache NiFi
Data ingestion and distribution with apache NiFiData ingestion and distribution with apache NiFi
Data ingestion and distribution with apache NiFi
 
Backing Library Operations with Open Source Applications
Backing Library Operations with Open Source ApplicationsBacking Library Operations with Open Source Applications
Backing Library Operations with Open Source Applications
 
Azkaban
AzkabanAzkaban
Azkaban
 
Managing Descriptive Metadata with Open XML...For Now
Managing Descriptive Metadata with Open XML...For NowManaging Descriptive Metadata with Open XML...For Now
Managing Descriptive Metadata with Open XML...For Now
 
Managing Exchange 2016 - Paul Robichaux
Managing Exchange 2016 - Paul RobichauxManaging Exchange 2016 - Paul Robichaux
Managing Exchange 2016 - Paul Robichaux
 
Nov 2014 webinar Making The Transition From Ftp
Nov 2014 webinar Making The Transition From FtpNov 2014 webinar Making The Transition From Ftp
Nov 2014 webinar Making The Transition From Ftp
 
LSC@LDAPCon 2011
LSC@LDAPCon 2011LSC@LDAPCon 2011
LSC@LDAPCon 2011
 

Viewers also liked

Tdd01 a simple intro to tdd
Tdd01 a simple intro to tddTdd01 a simple intro to tdd
Tdd01 a simple intro to tddMiguel Alho
 
Responsive design in sp seminar buildingi 20130918
Responsive design in sp seminar buildingi 20130918Responsive design in sp seminar buildingi 20130918
Responsive design in sp seminar buildingi 20130918Bill England
 
Ibm colloquium 070915_nyberg
Ibm colloquium 070915_nybergIbm colloquium 070915_nyberg
Ibm colloquium 070915_nybergdiannepatricia
 
Business innovation rick huijbregts 16oct2013
Business innovation   rick huijbregts 16oct2013Business innovation   rick huijbregts 16oct2013
Business innovation rick huijbregts 16oct2013Rick Huijbregts
 
Debi banks digital footprint
Debi banks digital footprintDebi banks digital footprint
Debi banks digital footprintDebi Banks
 
Birgit Plietzsch “RDM within research computing support” SALCTG June 2013
Birgit Plietzsch “RDM within research computing support” SALCTG June 2013Birgit Plietzsch “RDM within research computing support” SALCTG June 2013
Birgit Plietzsch “RDM within research computing support” SALCTG June 2013SALCTG
 
Μαθαίνω τον ΗΥ
Μαθαίνω τον ΗΥΜαθαίνω τον ΗΥ
Μαθαίνω τον ΗΥExpertin
 
Bba diversity conference report 6.5.12
Bba diversity conference report 6.5.12Bba diversity conference report 6.5.12
Bba diversity conference report 6.5.12SuffolkLALSA
 
СПГСГ,,Арх.Георги Козаров" гр.Сливен
СПГСГ,,Арх.Георги Козаров" гр.СливенСПГСГ,,Арх.Георги Козаров" гр.Сливен
СПГСГ,,Арх.Георги Козаров" гр.СливенИскра Косева
 
Центр поддержки экологических проектов
Центр поддержки экологических проектовЦентр поддержки экологических проектов
Центр поддержки экологических проектовkulibin
 
5 Tips on Twitter: #Live Storytelling w/ Patrick Stewart at #CannesLions #Ogi...
5 Tips on Twitter: #Live Storytelling w/ Patrick Stewart at #CannesLions #Ogi...5 Tips on Twitter: #Live Storytelling w/ Patrick Stewart at #CannesLions #Ogi...
5 Tips on Twitter: #Live Storytelling w/ Patrick Stewart at #CannesLions #Ogi...Ogilvy
 
Presentación sobre el Informe de Desarrollo Sostenible de Euskadi
Presentación sobre el Informe de Desarrollo Sostenible de EuskadiPresentación sobre el Informe de Desarrollo Sostenible de Euskadi
Presentación sobre el Informe de Desarrollo Sostenible de EuskadiPEGIP2020
 
Врезка_замка_в_межкомнатную_дверь
Врезка_замка_в_межкомнатную_дверьВрезка_замка_в_межкомнатную_дверь
Врезка_замка_в_межкомнатную_дверьspecdveri
 
5 Ways Your SMB Can Make More Money Using Social Media
5 Ways Your SMB Can Make More Money Using Social Media5 Ways Your SMB Can Make More Money Using Social Media
5 Ways Your SMB Can Make More Money Using Social MediaDave Kerpen
 
Albania america community twining project 01 club twin
Albania america community twining project  01 club twinAlbania america community twining project  01 club twin
Albania america community twining project 01 club twinAvi Dey
 
задание 6 насекина
задание 6 насекиназадание 6 насекина
задание 6 насекинаKriiiiis
 

Viewers also liked (20)

Tdd01 a simple intro to tdd
Tdd01 a simple intro to tddTdd01 a simple intro to tdd
Tdd01 a simple intro to tdd
 
Responsive design in sp seminar buildingi 20130918
Responsive design in sp seminar buildingi 20130918Responsive design in sp seminar buildingi 20130918
Responsive design in sp seminar buildingi 20130918
 
Ibm colloquium 070915_nyberg
Ibm colloquium 070915_nybergIbm colloquium 070915_nyberg
Ibm colloquium 070915_nyberg
 
Business innovation rick huijbregts 16oct2013
Business innovation   rick huijbregts 16oct2013Business innovation   rick huijbregts 16oct2013
Business innovation rick huijbregts 16oct2013
 
Return vs output
Return vs outputReturn vs output
Return vs output
 
Debi banks digital footprint
Debi banks digital footprintDebi banks digital footprint
Debi banks digital footprint
 
Birgit Plietzsch “RDM within research computing support” SALCTG June 2013
Birgit Plietzsch “RDM within research computing support” SALCTG June 2013Birgit Plietzsch “RDM within research computing support” SALCTG June 2013
Birgit Plietzsch “RDM within research computing support” SALCTG June 2013
 
Μαθαίνω τον ΗΥ
Μαθαίνω τον ΗΥΜαθαίνω τον ΗΥ
Μαθαίνω τον ΗΥ
 
Bba diversity conference report 6.5.12
Bba diversity conference report 6.5.12Bba diversity conference report 6.5.12
Bba diversity conference report 6.5.12
 
СПГСГ,,Арх.Георги Козаров" гр.Сливен
СПГСГ,,Арх.Георги Козаров" гр.СливенСПГСГ,,Арх.Георги Козаров" гр.Сливен
СПГСГ,,Арх.Георги Козаров" гр.Сливен
 
Центр поддержки экологических проектов
Центр поддержки экологических проектовЦентр поддержки экологических проектов
Центр поддержки экологических проектов
 
5 Tips on Twitter: #Live Storytelling w/ Patrick Stewart at #CannesLions #Ogi...
5 Tips on Twitter: #Live Storytelling w/ Patrick Stewart at #CannesLions #Ogi...5 Tips on Twitter: #Live Storytelling w/ Patrick Stewart at #CannesLions #Ogi...
5 Tips on Twitter: #Live Storytelling w/ Patrick Stewart at #CannesLions #Ogi...
 
New orleans
New orleansNew orleans
New orleans
 
Gotham ΙΙΙ
Gotham ΙΙΙGotham ΙΙΙ
Gotham ΙΙΙ
 
Presentación sobre el Informe de Desarrollo Sostenible de Euskadi
Presentación sobre el Informe de Desarrollo Sostenible de EuskadiPresentación sobre el Informe de Desarrollo Sostenible de Euskadi
Presentación sobre el Informe de Desarrollo Sostenible de Euskadi
 
Врезка_замка_в_межкомнатную_дверь
Врезка_замка_в_межкомнатную_дверьВрезка_замка_в_межкомнатную_дверь
Врезка_замка_в_межкомнатную_дверь
 
5 Ways Your SMB Can Make More Money Using Social Media
5 Ways Your SMB Can Make More Money Using Social Media5 Ways Your SMB Can Make More Money Using Social Media
5 Ways Your SMB Can Make More Money Using Social Media
 
Albania america community twining project 01 club twin
Albania america community twining project  01 club twinAlbania america community twining project  01 club twin
Albania america community twining project 01 club twin
 
1 cv en wilson couto
1 cv en wilson couto1 cv en wilson couto
1 cv en wilson couto
 
задание 6 насекина
задание 6 насекиназадание 6 насекина
задание 6 насекина
 

Similar to Delivering Changes for Applications and Databases

Operations for databases: the agile/devops journey
Operations for databases: the agile/devops journeyOperations for databases: the agile/devops journey
Operations for databases: the agile/devops journeyEduardo Piairo
 
Delivering changes for databases and applications
Delivering changes for databases and applicationsDelivering changes for databases and applications
Delivering changes for databases and applicationsEduardo Piairo
 
Workshop: Delivering chnages for applications and databases
Workshop: Delivering chnages for applications and databasesWorkshop: Delivering chnages for applications and databases
Workshop: Delivering chnages for applications and databasesEduardo Piairo
 
Deployment pipeline for databases
Deployment pipeline for databasesDeployment pipeline for databases
Deployment pipeline for databasesEduardo Piairo
 
Data Vault Automation at the Bijenkorf
Data Vault Automation at the BijenkorfData Vault Automation at the Bijenkorf
Data Vault Automation at the BijenkorfRob Winters
 
Road to database automation: database source control
Road to database automation: database source controlRoad to database automation: database source control
Road to database automation: database source controlEduardo Piairo
 
Why retail companies can't afford database downtime
Why retail companies can't afford database downtimeWhy retail companies can't afford database downtime
Why retail companies can't afford database downtimeDBmaestro - Database DevOps
 
Deployment pipeline for databases
Deployment pipeline for databasesDeployment pipeline for databases
Deployment pipeline for databasesEduardo Piairo
 
Database Source Control: Migrations vs State
Database Source Control: Migrations vs StateDatabase Source Control: Migrations vs State
Database Source Control: Migrations vs StateEduardo Piairo
 
SQL in Version Control using SQL Server Database Projects
SQL in Version Control using SQL Server Database ProjectsSQL in Version Control using SQL Server Database Projects
SQL in Version Control using SQL Server Database Projectsfloydhilton
 
DevOps+Data: Working with Source Control
DevOps+Data: Working with Source ControlDevOps+Data: Working with Source Control
DevOps+Data: Working with Source ControlEd Leighton-Dick
 
Continuous DB Changes Delivery With Liquibase
Continuous DB Changes Delivery With LiquibaseContinuous DB Changes Delivery With Liquibase
Continuous DB Changes Delivery With LiquibaseAidas Dragūnas
 
Operations for databases – the agile/devops journey
Operations for databases – the agile/devops journeyOperations for databases – the agile/devops journey
Operations for databases – the agile/devops journeyEduardo Piairo
 
Migrating Data Warehouse Solutions from Oracle to non-Oracle Databases
Migrating Data Warehouse Solutions from Oracle to non-Oracle DatabasesMigrating Data Warehouse Solutions from Oracle to non-Oracle Databases
Migrating Data Warehouse Solutions from Oracle to non-Oracle DatabasesJade Global
 
Presentation application change management and data masking strategies for ...
Presentation   application change management and data masking strategies for ...Presentation   application change management and data masking strategies for ...
Presentation application change management and data masking strategies for ...xKinAnx
 
Database Deployment Pipeline - SQL In The City Workshop 2014
Database Deployment Pipeline - SQL In The City Workshop 2014Database Deployment Pipeline - SQL In The City Workshop 2014
Database Deployment Pipeline - SQL In The City Workshop 2014Red Gate Software
 
Cloud-Native-Data with Cornelia Davis
Cloud-Native-Data with Cornelia DavisCloud-Native-Data with Cornelia Davis
Cloud-Native-Data with Cornelia DavisVMware Tanzu
 
Relational data modeling trends for transactional applications
Relational data modeling trends for transactional applicationsRelational data modeling trends for transactional applications
Relational data modeling trends for transactional applicationsIke Ellis
 

Similar to Delivering Changes for Applications and Databases (20)

Operations for databases: the agile/devops journey
Operations for databases: the agile/devops journeyOperations for databases: the agile/devops journey
Operations for databases: the agile/devops journey
 
Delivering changes for databases and applications
Delivering changes for databases and applicationsDelivering changes for databases and applications
Delivering changes for databases and applications
 
Workshop: Delivering chnages for applications and databases
Workshop: Delivering chnages for applications and databasesWorkshop: Delivering chnages for applications and databases
Workshop: Delivering chnages for applications and databases
 
Deployment pipeline for databases
Deployment pipeline for databasesDeployment pipeline for databases
Deployment pipeline for databases
 
Data Vault Automation at the Bijenkorf
Data Vault Automation at the BijenkorfData Vault Automation at the Bijenkorf
Data Vault Automation at the Bijenkorf
 
Road to database automation: database source control
Road to database automation: database source controlRoad to database automation: database source control
Road to database automation: database source control
 
Why retail companies can't afford database downtime
Why retail companies can't afford database downtimeWhy retail companies can't afford database downtime
Why retail companies can't afford database downtime
 
Deployment pipeline for databases
Deployment pipeline for databasesDeployment pipeline for databases
Deployment pipeline for databases
 
Database Source Control: Migrations vs State
Database Source Control: Migrations vs StateDatabase Source Control: Migrations vs State
Database Source Control: Migrations vs State
 
SQL in Version Control using SQL Server Database Projects
SQL in Version Control using SQL Server Database ProjectsSQL in Version Control using SQL Server Database Projects
SQL in Version Control using SQL Server Database Projects
 
DevOps+Data: Working with Source Control
DevOps+Data: Working with Source ControlDevOps+Data: Working with Source Control
DevOps+Data: Working with Source Control
 
Continuous DB Changes Delivery With Liquibase
Continuous DB Changes Delivery With LiquibaseContinuous DB Changes Delivery With Liquibase
Continuous DB Changes Delivery With Liquibase
 
Database CI/CD Pipeline
Database CI/CD PipelineDatabase CI/CD Pipeline
Database CI/CD Pipeline
 
Operations for databases – the agile/devops journey
Operations for databases – the agile/devops journeyOperations for databases – the agile/devops journey
Operations for databases – the agile/devops journey
 
Migrating Data Warehouse Solutions from Oracle to non-Oracle Databases
Migrating Data Warehouse Solutions from Oracle to non-Oracle DatabasesMigrating Data Warehouse Solutions from Oracle to non-Oracle Databases
Migrating Data Warehouse Solutions from Oracle to non-Oracle Databases
 
Presentation application change management and data masking strategies for ...
Presentation   application change management and data masking strategies for ...Presentation   application change management and data masking strategies for ...
Presentation application change management and data masking strategies for ...
 
Database Deployment Pipeline - SQL In The City Workshop 2014
Database Deployment Pipeline - SQL In The City Workshop 2014Database Deployment Pipeline - SQL In The City Workshop 2014
Database Deployment Pipeline - SQL In The City Workshop 2014
 
Cloud-native Data
Cloud-native DataCloud-native Data
Cloud-native Data
 
Cloud-Native-Data with Cornelia Davis
Cloud-Native-Data with Cornelia DavisCloud-Native-Data with Cornelia Davis
Cloud-Native-Data with Cornelia Davis
 
Relational data modeling trends for transactional applications
Relational data modeling trends for transactional applicationsRelational data modeling trends for transactional applications
Relational data modeling trends for transactional applications
 

More from Miguel Alho

Four Key Metrics @ DevOps Aveiro #1
Four Key Metrics @ DevOps Aveiro #1Four Key Metrics @ DevOps Aveiro #1
Four Key Metrics @ DevOps Aveiro #1Miguel Alho
 
Programacão para não programadores
Programacão para não programadoresProgramacão para não programadores
Programacão para não programadoresMiguel Alho
 
5 Pontos sobre desenvolvimento de software
5 Pontos sobre desenvolvimento de software5 Pontos sobre desenvolvimento de software
5 Pontos sobre desenvolvimento de softwareMiguel Alho
 
Aspectos profissionais 3pontos
Aspectos profissionais 3pontosAspectos profissionais 3pontos
Aspectos profissionais 3pontosMiguel Alho
 

More from Miguel Alho (6)

Four Key Metrics @ DevOps Aveiro #1
Four Key Metrics @ DevOps Aveiro #1Four Key Metrics @ DevOps Aveiro #1
Four Key Metrics @ DevOps Aveiro #1
 
Kanban
KanbanKanban
Kanban
 
Programacão para não programadores
Programacão para não programadoresProgramacão para não programadores
Programacão para não programadores
 
5 Pontos sobre desenvolvimento de software
5 Pontos sobre desenvolvimento de software5 Pontos sobre desenvolvimento de software
5 Pontos sobre desenvolvimento de software
 
Web 3.0
Web 3.0Web 3.0
Web 3.0
 
Aspectos profissionais 3pontos
Aspectos profissionais 3pontosAspectos profissionais 3pontos
Aspectos profissionais 3pontos
 

Recently uploaded

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 

Recently uploaded (20)

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 

Delivering Changes for Applications and Databases

  • 1. Delivering changes for applications and databases “The beginning of a beautiful friendship” Eduardo Piairo Miguel Alho
  • 2. Delivering changes for applications and databases @EdPiairo https://pt.linkedin.com/in/jesuspiairo eduardopiairo@outlook.com http://www.eduardopiairo.com/ Eduardo Piairo, DBA & DevOps @ Celfinet
  • 3. Delivering changes for applications and databases @MytyMyky https://pt.linkedin.com/in/miguelalho-982331 alho@miguelalho.com http://www.miguelalho.pt/ Miguel Alho, Software Engineer @ Faro Europe
  • 5. Delivering changes for applications and databases Source Control Continuous Integration Continuous Delivery Database + Application
  • 6. What’s so special about the database?
  • 7. What’s so special about the database?
  • 8. DLM – Database Lifecycle Management Data management and data migration Data monitoring Data recovery
  • 9. Typical problems we want to fix • Databases are out of pace with application development • Lack of traceability of database changes (changes history) • Manual databases processes prevent the CI and CD utilization • Lack of testability • Database setup time for new environments • Bugs in production
  • 10. Typical problems we want to fix Databases becoming a bottleneck in an agile delivery process
  • 11. Typical problems we want to fix Databases becoming an easy target to blame
  • 12.
  • 13. Why database automation? • Enable control over database development • Increase speed of response to change • Keep a versioned “history” of database states and changes • Reliability of the release process • Increase release frequency though repeatability of processes • Reduce time spent fixing bugs - automated tests • Remove/reduce human intervention in the release process
  • 15. 1st step: Source Control • First step in your database deployment pipeline • Traceability through change history • SQL as documentation • Shared code-base and shared process • Enforceable standards to reduce conflicts
  • 16. 1st Step: Source Control Fundamental resource: SQL Script
  • 17. Migrations-based approach vs State-based approach • 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
  • 18. Flyway • Flyway – “Database Migrations made Easy” http://flywaydb.org/ • Open source database migration tool • Flyway command-line enabled Simplicity: easy to setup, no need to install Zero dependencies (java + jdbc) Scripts are written in SQL
  • 19. Flyway – How does it work? • Flyway commands: • migrate, clean, info, validate, baseline, repair • Metadata table: • Used to track the state of the database • 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
  • 20. Version Control System Two components: Database scripts repository Flyway – database migrations Rule 1: Script version (timestamp) Rule 2: Operation type Rule 3: Object type Rule 4: Object name Example: V20160728.1100__Create_TB_MyTable.sql
  • 21. Demo
  • 22. How about applications? It takes two to tango
  • 23. Database and Application change alignment ● Database schemas should evolve along with application evolution ○ deploy app => deploy changes / migrations ● (Integration) Test app and db changes together ○ should pass tests while developing, ○ should pass tests while promoting to new environments ● Ideally, one application per database ● Pipeline deployment only!
  • 24. Integration test at the database layer ● Use TDD techniques ● Limit database integration tests to data layer ○ faster tests! ○ validate sql and mappings ● Always test with the latest schema DatabaseApplication DatabaseApplication
  • 27. Database and Application change alignment Fearless database changes
  • 28. Challenges • Challenge #1: managing multiple branches • Manage merge conflicts • The default branch is the main/master branch and all the merges for this branch must be done with caution
  • 29. Challenges • Challenge #2: Script expiration date • Should the migration script have an expiration date? • Sometimes, in the next day, the migration script no longer makes sense
  • 30. Challenges • Challenge #3: migration scripts stack • How can I manage the dependencies between different databases?
  • 31. Challenges • Challenge #4: developer sandbox • How to supply a disposable development environment where the database is included?
  • 33. Links ● https://github.com/MiguelAlho/Purchases-DbMigration-sample https://flywaydb.org/ ● http://dbup.github.io/ ● http://www.red-gate.com/products/sql-development/sql-compare/ ● https://octopus.com/ ○ http://docs.octopusdeploy.com/display/OD/Deploying+ASP.NET+Core+Web+Applications ● https://www.visualstudio.com/ ●
  • 35. Delivering changes for applications and databases @EdPiairo https://pt.linkedin.com/in/jesuspiairo eduardopiairo@outlook.com http://www.eduardopiairo.com/ @MytyMyky https://pt.linkedin.com/in/miguelalho-982331 alho@miguelalho.com http://www.miguelalho.pt/