SlideShare a Scribd company logo
Perché è così difficile il deploy dei database?
Giulio Vian
Senior DevOps Engineer, Unum
I problemi
Sovrapposizione Campionatura
Distacco
© Lauren Knipp
DBA
Senior
Dev
Scrum
Master
Junior
Dev
In a Start-up far far away
Gratis!
Troppo bello per
esser vero
• gratis
• open source
• tutti i DB!
• ed è pure usato
• e funziona!
Passano
I mesi
fino
ad un certo
venerdì
Perché è così difficile il deploy dei database  - DevCast DevOps Serie
Colpiamo il nemico
con dacpac
con Doctrine Migrations
con …
la rivelazione
La legge
di Murphy
Non ha
eccezioni
Hardware spec:
1 KB RAM
(16KB after upgrade)
4 KB ROM
(8KB after upgrade)
First computer Past Companies Communities
Giulio Vian Senior DevOps Engineer
@giulio_vian
giuliovdev@hotmail.com
Agenda
Paradigmi cambiamento
Test Automatizzati
Tecniche per il Deploy
Paradigmi
Migration-based
Source: https://www.red-gate.com/hub/product-learning/sql-source-control/moving-from-application-automation-to-true-devops-by-including-the-database
Baseline (aka v0.0.0)
Script di migrazione independentI
Conflitto?
State-based
Source: https://www.red-gate.com/hub/product-learning/sql-source-control/moving-from-application-automation-to-true-devops-by-including-the-database
Diff script from schema-based tool
uh oh
Migration based
v1  v2
Non rileva conflitti
L’ordine è cruciale
State based
v1  v2
Non riconosce i rename
Azzera eventuali
differenze
I due paradigmi
Migration based
v1  v2
State based
v1  v2
Cosa usare
Migration based
v1  v2
Tante versioni in
esercizio
• On-premises
• Clients
State based
v1  v2
Una sola versione in
produzione
• On-line services
I due paradigmi
Test
Unit testing
tSQLt
Open source database Unit Testing
framework for SQL Server
https://tsqlt.org/
DbUnit
JUnit extension
http://www.dbunit.org/
NDbUnit2
.NET library for managing database state
during unit testing
https://github.com/savornicesei/NDbUnit
2
DbFit
Fitness style (Java+Jdbc)
http://dbfit.github.io/dbfit/
Respawn
Intelligent database cleaner for
integration tests
https://github.com/jbogard/Respawn
Reset del Database
Containers
Virtual Machines
Volume Snapshots
Database Snapshots
Dati RealisticI
Dimensioni
Requisiti di riservatezza
(PII)
Pre-trattamento
Masking / Substitution / Encryption /
Shuffling / Generation
Spazio occupato
Conseguenze
Problemi tecnici
Durata del Deployment
Performance delle query
Problemi commerciali e legali
Abuso di informazioni
Deploy
Database Refactoring Cycle
Initial state Final state
Implement the refactoring
Test on non-production
Refactoring completed
deploy new schema,
migrate data
deploy new application version
Forward change
Tempo di migrazione dei dati
Database Refactoring Cycle
Initial state Final state
Implement the refactoring
Test on non-production
Refactoring completed
deploy new schema,
migrate data
deploy new application version
Rollback
Perdita di dati contenuti nelle nuove strutture
Database Refactoring Cycle
Initial state Final state
Transitional state
Implement the refactoring
Test on non-production
Refactoring completed
All systems use the new schema
Coexistence of
old and new schema
Expand:
deploy new schema,
migrate data,
add scaffolding code
Contract:
Drop old schema objects
and scaffolding code
Elementi Chiave
In input solo sorgenti
Pacchetti (es. dacpac) vanno in un Artifact Store
e devono essere il risultato di una build
Istanze di database per la build
Ad ogni Branch la sua Istanza
Gestione delle credenziali
Riassumendo
applicazioni
DATi
La morale
Nessun tool
ti può salvare
Studiare è
l’unico modo
di prevenire
problemi
Disciplina,
tanta
disciplina
Strumenti
Open source
Liquibase
Flyway
dbup
gitSQL
DbPatch
dbdeploy.net
OnlineSchemaChange
Prodotti
SQL Server Data Tools (SSDT)
RedGate SQL Compare
devart
Bibliografia: Articoli
Schema migration
Evolutionary Database Design
100% Online Deployments
Blue-Turquoise-Green
Deployment
ALTER MySQL tables without
locking them
Automated blue/green
database deployments
Blue-Green Deployment on
AWS with Database
Synchronisation
Bibliografia: Libri
Refactoring Databases: Evolutionary Database Design
http://www.agiledata.org/
Grazie e attendo le vostre domande
Giulio Vian
Senior DevOps Engineer, Unum
Il contenuto della presentazione ha carattere
didattico. Ogni sforzo è stato fatto per risalire agli
autori delle immagini impiegate. In caso di errori od
omissioni, vi chiediamo di segnalarli per procedere
alle correzioni.

More Related Content

PPTX
DotNetCampus - Continuous Integration con Sql Server
PPTX
Javascript task automation
PPTX
Introduzione ad ASP.NET Core
PDF
Continuous Delivery Database - Diego Mauricio Lagos Morales - Codemotion Rome...
PDF
Alla scoperta di gRPC
PPTX
Javascript task automation
PDF
Meetup Azure DevOps
PPTX
Azure dev ops meetup one
DotNetCampus - Continuous Integration con Sql Server
Javascript task automation
Introduzione ad ASP.NET Core
Continuous Delivery Database - Diego Mauricio Lagos Morales - Codemotion Rome...
Alla scoperta di gRPC
Javascript task automation
Meetup Azure DevOps
Azure dev ops meetup one

What's hot (20)

PPTX
Java EE facile con Spring Boot - Luigi Bennardis - Codemotion Roma 2015
PDF
Back to the Future: Migrare da WebForm ad ASP.NET Core gradualmente
PPTX
Windows azure - abbattere tempi e costi di sviluppo
PPTX
SQL Saturday 871 - Sardegna 2019 - SQL Server DR on Azure
PPTX
Dot netcampus2015 green-template
PPTX
[ITA] Sql Saturday 355 in Parma - New SQL Server databases under source control
PPTX
Akka.net & Actor Model
PDF
Dependency injection questa sconosciuta
PPTX
Costruisci il tuo device
PDF
Making Chatbots
PPTX
DbUp - A real case of database migration
PPTX
Database project alla riscossa
PPTX
Async: scalabilità e responsiveness senza pari! @ CDays
PPTX
Creare API pubbliche, come evitare gli errori comuni
PDF
AntiPatterns: i vizi del programmatore
PPTX
Slide typescript - net campus
PDF
Blazor ha vinto? Storie di casi reali
PPTX
Wcf data services
PPTX
70-485: ADVANCED OF DEVELOPING WINDOWS STORE APPS USING C#
PPTX
COSTRUISCI IL TUO DEVICE
Java EE facile con Spring Boot - Luigi Bennardis - Codemotion Roma 2015
Back to the Future: Migrare da WebForm ad ASP.NET Core gradualmente
Windows azure - abbattere tempi e costi di sviluppo
SQL Saturday 871 - Sardegna 2019 - SQL Server DR on Azure
Dot netcampus2015 green-template
[ITA] Sql Saturday 355 in Parma - New SQL Server databases under source control
Akka.net & Actor Model
Dependency injection questa sconosciuta
Costruisci il tuo device
Making Chatbots
DbUp - A real case of database migration
Database project alla riscossa
Async: scalabilità e responsiveness senza pari! @ CDays
Creare API pubbliche, come evitare gli errori comuni
AntiPatterns: i vizi del programmatore
Slide typescript - net campus
Blazor ha vinto? Storie di casi reali
Wcf data services
70-485: ADVANCED OF DEVELOPING WINDOWS STORE APPS USING C#
COSTRUISCI IL TUO DEVICE
Ad

Similar to Perché è così difficile il deploy dei database - DevCast DevOps Serie (20)

PPTX
Database Project in Visual Studio 2010
PPT
Marco Zani: Come dimensionare Magento per raggiungere i Key Performance Indic...
PPTX
Webinar: "Il database: l’equipaggiamento su cui fare affidamento"
PPTX
Moving from Monolithic to Microservice Architecture: an OSS based stack deplo...
PDF
Agileday2013 pratiche agili applicate all'infrastruttura
PDF
Software Testing e TDD
PPTX
DevOpsHeroes 2016 - Realizzare Continouous Integration con SQL Server e Visua...
PPTX
PASS Virtual Chapter - SQL Server Continuous Integration
ODP
Working between the clouds
PPTX
2014.11.14 Implementare e mantenere un progetto Azure SQL Database
PDF
Power BI: Introduzione ai dataflow e alla preparazione dei dati self-service
ODP
Working between the clouds (versione completa)
PPTX
CONTINUOUS INTEGRATION CON SQL SERVER
PPTX
JAVASCRIPT TASK AUTOMATION
PPTX
2014.11.14 Implementare e mantenere un progetto Azure SQL Database
PDF
Polyglot Persistance con PostgreSQL, CouchDB, MongoDB, Redis e OrientDB
PPTX
PASS Virtual Chapter - Unit Testing su SQL Server
PPTX
Dal requisito all'implementazione @ CD2010
PDF
Come l’Open Source può essere alla base di un business di successo: il caso H...
PDF
App Engine + Python
Database Project in Visual Studio 2010
Marco Zani: Come dimensionare Magento per raggiungere i Key Performance Indic...
Webinar: "Il database: l’equipaggiamento su cui fare affidamento"
Moving from Monolithic to Microservice Architecture: an OSS based stack deplo...
Agileday2013 pratiche agili applicate all'infrastruttura
Software Testing e TDD
DevOpsHeroes 2016 - Realizzare Continouous Integration con SQL Server e Visua...
PASS Virtual Chapter - SQL Server Continuous Integration
Working between the clouds
2014.11.14 Implementare e mantenere un progetto Azure SQL Database
Power BI: Introduzione ai dataflow e alla preparazione dei dati self-service
Working between the clouds (versione completa)
CONTINUOUS INTEGRATION CON SQL SERVER
JAVASCRIPT TASK AUTOMATION
2014.11.14 Implementare e mantenere un progetto Azure SQL Database
Polyglot Persistance con PostgreSQL, CouchDB, MongoDB, Redis e OrientDB
PASS Virtual Chapter - Unit Testing su SQL Server
Dal requisito all'implementazione @ CD2010
Come l’Open Source può essere alla base di un business di successo: il caso H...
App Engine + Python
Ad

More from Giulio Vian (20)

PPTX
Come implementare la governance nella vostra piattaforma e lavorare felici se...
PDF
Is Technical Debt the right metaphor for Continuous Update?
PPTX
Is Technical Debt the right metaphor for Continuous Update - AllDayDevOps 2022
PPTX
Software rotting - DevOpsCon Berlin
PPTX
Software rotting
PPTX
Software rotting - 28 Apr - DeveloperWeek Europe 2022
PPTX
L'impatto della sicurezza su DevOps
PPTX
L'impatto della sicurezza su DevOps
PPTX
A map for DevOps on Microsoft Stack - MS DevSummit
PPTX
Database deployments - dotnetsheff
PPTX
Database deployment: still hard after all these years - Data Saturday #1
PPTX
Pipeline your Pipelines - 2020 All Day DevOps
PPTX
How to write cloud-agnostic Terraform code - Incontro DevOps Italia 2020
PPTX
Top 10 pipeline mistakes - dotnetsheff
PPTX
Introduction to Terraform with Azure flavor
PPTX
How collaboration works between Dev and Ops - DevOps Agile Testing and Test S...
PPTX
Usare SQL Server for Linux e Docker per semplificare i processi di testing - ...
PPTX
Pipeline your pipelines!
PPTX
Why is DevOps vital for my company’s business
PPTX
Introduzione a GitHub Actions (beta)
Come implementare la governance nella vostra piattaforma e lavorare felici se...
Is Technical Debt the right metaphor for Continuous Update?
Is Technical Debt the right metaphor for Continuous Update - AllDayDevOps 2022
Software rotting - DevOpsCon Berlin
Software rotting
Software rotting - 28 Apr - DeveloperWeek Europe 2022
L'impatto della sicurezza su DevOps
L'impatto della sicurezza su DevOps
A map for DevOps on Microsoft Stack - MS DevSummit
Database deployments - dotnetsheff
Database deployment: still hard after all these years - Data Saturday #1
Pipeline your Pipelines - 2020 All Day DevOps
How to write cloud-agnostic Terraform code - Incontro DevOps Italia 2020
Top 10 pipeline mistakes - dotnetsheff
Introduction to Terraform with Azure flavor
How collaboration works between Dev and Ops - DevOps Agile Testing and Test S...
Usare SQL Server for Linux e Docker per semplificare i processi di testing - ...
Pipeline your pipelines!
Why is DevOps vital for my company’s business
Introduzione a GitHub Actions (beta)

Perché è così difficile il deploy dei database - DevCast DevOps Serie

Editor's Notes

  • #11: 10,000+ employees (1,000+ in IT) ~$12 billion Revenue
  • #14: Source https://www.red-gate.com/hub/product-learning/sql-source-control/moving-from-application-automation-to-true-devops-by-including-the-database
  • #15: Source http://workingwithdevs.com/delivering-databases-migrations-vs-state/
  • #16: Source http://workingwithdevs.com/delivering-databases-migrations-vs-state/
  • #17: Source https://www.red-gate.com/hub/product-learning/sql-source-control/moving-from-application-automation-to-true-devops-by-including-the-database
  • #18: Source http://workingwithdevs.com/delivering-databases-migrations-vs-state/
  • #25: General Data Protection Regulation California Consumer Privacy Act …
  • #36: Giovanni Francesco Barbieri detto il Guercino (1591-1666) Atlante che sostiene il globo celeste, 1646 Firenze, Museo Mozzi Bardini, inv. MCF-MB 1922-1148.a Il mito del titano Atlante condannato da Zeus a sorreggere la volta celeste per l’eternità ebbe notevole fortuna iconografica nel corso del Seicento. Tra le opere più famose è questa versione, dipinta per Lorenzo de’ Medici.
  • #38: https://github.com/facebookincubator/OnlineSchemaChange https://www.percona.com/doc/percona-toolkit/3.0/pt-online-schema-change.html https://octopus.com/blog/databases-with-blue-green-deployments https://www.linkedin.com/pulse/blue-green-deployment-aws-database-synchronisation-james-chan
  • #39: https://github.com/facebookincubator/OnlineSchemaChange https://www.percona.com/doc/percona-toolkit/3.0/pt-online-schema-change.html https://octopus.com/blog/databases-with-blue-green-deployments https://www.linkedin.com/pulse/blue-green-deployment-aws-database-synchronisation-james-chan