SlideShare a Scribd company logo
1 of 28
#sqlinthecity

Automated Build and Test
(or continuous integration)
(for your database)

David Atkinson
Product Manager, Red Gate
David.Atkinson@red-gate.com
#sqlinthecity

What will we cover today?

Database build automation:
What, Why, How
Practical Demo
Questions encouraged!
#sqlinthecity

Show of hands:
How agile is your database development?
1. Database objects/scripts aren’t in version control
2. Database objects/scripts are in version control
3. An automated build system exists to build and test
the database
4. An automated release system is used to promote
your database to your environments
#sqlinthecity

How agile is your database development?
1. Database objects/scripts aren’t in version control
2. Database objects/scripts are in version control
3. An automated build system exists to build and test
the database
4. An automated release system is used to promote
your database to your environments
#sqlinthecity

What is continuous integration?
“Continuous Integration is a practice
designed to ensure that your software is always
working, and that you get comprehensive
feedback in a few minutes as to whether any
given change to your system has broken it.”
Jez Humble, ThoughtWorks, author of
“Continuous Delivery”
database

#sqlinthecity

What is continuous integration?
^

“Database Continuous Integration is a
practice designed to ensure that your database
software is always working, and that you get
comprehensive feedback in a few minutes as to
whether any given change to your system has
broken it.”
#sqlinthecity

Database Build Automation
#sqlinthecity

What is build?
• For application code = compile
• For database code = database creation script
– But only for a new installation!
• Upgrade scripts required for existing
installations
– Need to preserve the state of the data
#sqlinthecity

What is test?
• For .NET code, NUnit.
– Runs on a developer’s machine and build
server
• What about the database?
– tSQLt is an open source framework for testing
SQL Server databases
– SQL Test provides SSMS integration
#sqlinthecity

Demo background
Two fictional developers, David and Grant,
are working on the website, www.simpletalk.com, a community website for .NET
and SQL Server developers
The application comprises
• An ASP.Net web application
• A SQL Server database
#sqlinthecity

Demo background
Continuous integration has been configured
to:
1. Keep a test database up to date with the
latest changes
2. Run automated tSQLt tests
(on realistic amounts of data)

3. Generate up-to-date documentation
4. Generate deployment scripts
#sqlinthecity

Demo background
A few improvements are being made to
Simple Talk.
These changes will be deployed to
production.
But… only when the dev team has
demonstrated that the changes work!
#sqlinthecity

Tools used
• TeamCity (CI tool from JetBrains)
• SQL Automation Pack (includes TeamCity plugin)
• Glimpse (open source)

From the SQL Developer Bundle:
•
•
•
•

SQL Source Control
SQL Test (tSQLt unit testing framework)
SQL Data Generator
SQL Doc
#sqlinthecity

Demo
Custom Migration Scripts
An introduction

#sqlinthecity
#sqlinthecity

Generating a deployment script
1

12
#sqlinthecity

How changes are made
create
table

modify
procedure

1

2

3

delete
column

create
trigger

drop
view

4

5

6
#sqlinthecity

How changes are made
create
table

modify
procedure

1

2

modify
trigger

create
function

7

3

drop
procedure

8

4

10

6

5

create
view

modify
function

9

delete
column

create
trigger

drop
view

create
procedure

11

12
#sqlinthecity

How SQL Compare sees the world
1

12
#sqlinthecity

But not all changes can be inferred
1

2

3

5

column
rename

merge table

8

merge column
split column

9

6

add NOT NULL
column without
DEFAULT

table
rename

split table

7

4

10

11

data transformation
data motion

12
#sqlinthecity

SQL Compare and SQL Source Control
support custom migration scripts
1

2

3

4

5

6

11

12

Custom migration script

7

8

9

10
#sqlinthecity

Deployment script with migration
scripts
1

12
#sqlinthecity

1
1’
12
#sqlinthecity

Demo
#sqlinthecity

Recap: database CI
1. Incrementally keeps a test database up to date
2. Runs tSQLt tests on a database with realistic
amounts of data
3. Generates always-up-to-date documentation
4. Generates and validates deployment scripts
5. Publishes a Deployment Manager database
package
#sqlinthecity

Recap of demo: writing a test
1.
2.
3.
4.
5.

A new test is added
Continuous Integration identifies a failure
We reproduce the bug locally
We fix the bug and test it
We commit the fix to source control
#sqlinthecity

Recap: migration scripts
1. The fix sets the [PublishDate] column from NULL to
NOT NULL
2. Grant’s “get latest” fails because existing data that
has NULL values
3. The continuous integration build alerts us of the
same issue
4. A migration script is added to UPDATE existing
data prior to changing the column to NOT NULL
5. Get Latest becomes possible and the continuous
integration build once again indicates working
software
#sqlinthecity

Latest version at :

www.red-gate.com/CI
David.Atkinson@red-gate.com

Questions?

More Related Content

What's hot

Database continuous integration, unit test and functional test
Database continuous integration, unit test and functional testDatabase continuous integration, unit test and functional test
Database continuous integration, unit test and functional testHarry Zheng
 
Automate Database Deployment - SQL In The City Workshop
Automate Database Deployment - SQL In The City WorkshopAutomate Database Deployment - SQL In The City Workshop
Automate Database Deployment - SQL In The City WorkshopRed Gate Software
 
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
 
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
 
Successfully migrating existing databases to Azure
Successfully migrating existing databases to AzureSuccessfully migrating existing databases to Azure
Successfully migrating existing databases to AzureRed Gate Software
 
Delphix and DBmaestro
Delphix and DBmaestroDelphix and DBmaestro
Delphix and DBmaestroKyle Hailey
 
Best Practices for Database Deployments
Best Practices for Database DeploymentsBest Practices for Database Deployments
Best Practices for Database DeploymentsRed Gate Software
 
Continuous Delivery & the Database - the Final Frontier
Continuous Delivery & the Database - the Final FrontierContinuous Delivery & the Database - the Final Frontier
Continuous Delivery & the Database - the Final FrontierXebiaLabs
 
Continuous Delivery & the Database- The Final Frontier
Continuous Delivery & the Database- The Final FrontierContinuous Delivery & the Database- The Final Frontier
Continuous Delivery & the Database- The Final FrontierDBmaestro - Database DevOps
 
Challenges and Best Practices of Database Continuous Delivery
Challenges and Best Practices of Database Continuous DeliveryChallenges and Best Practices of Database Continuous Delivery
Challenges and Best Practices of Database Continuous DeliveryDBmaestro - Database DevOps
 
Chef Delivery
Chef DeliveryChef Delivery
Chef DeliveryChef
 
Continuous integration sql in the city
Continuous integration sql in the cityContinuous integration sql in the city
Continuous integration sql in the cityIke Ellis
 
Continuous integration
Continuous integrationContinuous integration
Continuous integrationhugo lu
 
Why source control your Oracle Database?
Why source control your Oracle Database?Why source control your Oracle Database?
Why source control your Oracle Database?Red Gate Software
 
Dynamic bpm design by doing lightning talk
Dynamic bpm design by doing lightning talkDynamic bpm design by doing lightning talk
Dynamic bpm design by doing lightning talkITD Systems
 
JUC Europe 2015: How to Optimize Automated Testing with Everyone's Favorite B...
JUC Europe 2015: How to Optimize Automated Testing with Everyone's Favorite B...JUC Europe 2015: How to Optimize Automated Testing with Everyone's Favorite B...
JUC Europe 2015: How to Optimize Automated Testing with Everyone's Favorite B...CloudBees
 
The Future of Change Management and DevOps for Dummies
The Future of Change Management and DevOps for DummiesThe Future of Change Management and DevOps for Dummies
The Future of Change Management and DevOps for DummiesDBmaestro - Database DevOps
 
The Key Components of Adopting CI The OpenStack Way
The Key Components of Adopting CI The OpenStack WayThe Key Components of Adopting CI The OpenStack Way
The Key Components of Adopting CI The OpenStack WayiWeb (group INAP)
 

What's hot (20)

In (database) automation we trust
In (database) automation we trustIn (database) automation we trust
In (database) automation we trust
 
Database continuous integration, unit test and functional test
Database continuous integration, unit test and functional testDatabase continuous integration, unit test and functional test
Database continuous integration, unit test and functional test
 
Automate Database Deployment - SQL In The City Workshop
Automate Database Deployment - SQL In The City WorkshopAutomate Database Deployment - SQL In The City Workshop
Automate Database Deployment - SQL In The City Workshop
 
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
 
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
 
Successfully migrating existing databases to Azure
Successfully migrating existing databases to AzureSuccessfully migrating existing databases to Azure
Successfully migrating existing databases to Azure
 
Delphix and DBmaestro
Delphix and DBmaestroDelphix and DBmaestro
Delphix and DBmaestro
 
Best Practices for Database Deployments
Best Practices for Database DeploymentsBest Practices for Database Deployments
Best Practices for Database Deployments
 
Continuous Delivery & the Database - the Final Frontier
Continuous Delivery & the Database - the Final FrontierContinuous Delivery & the Database - the Final Frontier
Continuous Delivery & the Database - the Final Frontier
 
Continuous Delivery & the Database- The Final Frontier
Continuous Delivery & the Database- The Final FrontierContinuous Delivery & the Database- The Final Frontier
Continuous Delivery & the Database- The Final Frontier
 
Challenges and Best Practices of Database Continuous Delivery
Challenges and Best Practices of Database Continuous DeliveryChallenges and Best Practices of Database Continuous Delivery
Challenges and Best Practices of Database Continuous Delivery
 
Chef Delivery
Chef DeliveryChef Delivery
Chef Delivery
 
Continuous integration sql in the city
Continuous integration sql in the cityContinuous integration sql in the city
Continuous integration sql in the city
 
Continuous integration
Continuous integrationContinuous integration
Continuous integration
 
Why source control your Oracle Database?
Why source control your Oracle Database?Why source control your Oracle Database?
Why source control your Oracle Database?
 
Dynamic bpm design by doing lightning talk
Dynamic bpm design by doing lightning talkDynamic bpm design by doing lightning talk
Dynamic bpm design by doing lightning talk
 
Scaling Jenkins
Scaling Jenkins Scaling Jenkins
Scaling Jenkins
 
JUC Europe 2015: How to Optimize Automated Testing with Everyone's Favorite B...
JUC Europe 2015: How to Optimize Automated Testing with Everyone's Favorite B...JUC Europe 2015: How to Optimize Automated Testing with Everyone's Favorite B...
JUC Europe 2015: How to Optimize Automated Testing with Everyone's Favorite B...
 
The Future of Change Management and DevOps for Dummies
The Future of Change Management and DevOps for DummiesThe Future of Change Management and DevOps for Dummies
The Future of Change Management and DevOps for Dummies
 
The Key Components of Adopting CI The OpenStack Way
The Key Components of Adopting CI The OpenStack WayThe Key Components of Adopting CI The OpenStack Way
The Key Components of Adopting CI The OpenStack Way
 

Viewers also liked

Search Intelligence - Social Media e Search Marketing - Proxxima 2011
Search Intelligence - Social Media e Search Marketing - Proxxima 2011Search Intelligence - Social Media e Search Marketing - Proxxima 2011
Search Intelligence - Social Media e Search Marketing - Proxxima 2011Leonardo Naressi
 
Guía de análisis de fuentes
Guía de análisis de fuentesGuía de análisis de fuentes
Guía de análisis de fuentesSgarcia137
 
Curso: Redes y telecomunicaciones: 06 Protocolo IPv4
Curso: Redes y telecomunicaciones: 06 Protocolo IPv4Curso: Redes y telecomunicaciones: 06 Protocolo IPv4
Curso: Redes y telecomunicaciones: 06 Protocolo IPv4Jack Daniel Cáceres Meza
 
N tier architecture
N tier architectureN tier architecture
N tier architectureNidhi Saurav
 
6ª Manoca do Canto Gaúcho Fase Local
6ª Manoca do Canto Gaúcho Fase Local6ª Manoca do Canto Gaúcho Fase Local
6ª Manoca do Canto Gaúcho Fase Localmanocadocantogaucho
 
Future in focus brazil mar2012 final
Future in focus brazil mar2012 finalFuture in focus brazil mar2012 final
Future in focus brazil mar2012 finalLeonardo Naressi
 
Passeioda8seriefazzendaparkhotel
Passeioda8seriefazzendaparkhotelPasseioda8seriefazzendaparkhotel
Passeioda8seriefazzendaparkhotelmidiasvidal
 
Modelagem e Análise de Dados em PPC - Search Masters Brasil 2013
Modelagem e Análise de Dados em PPC - Search Masters Brasil 2013Modelagem e Análise de Dados em PPC - Search Masters Brasil 2013
Modelagem e Análise de Dados em PPC - Search Masters Brasil 2013Leonardo Naressi
 
Brand story
Brand storyBrand story
Brand storyAli Hadi
 
Veritas - resiliency platform
Veritas - resiliency platformVeritas - resiliency platform
Veritas - resiliency platformFernando Alves
 
Estudo 15 11 - aspectos importantes da oração bem sucedida
Estudo 15  11 - aspectos importantes da oração bem sucedidaEstudo 15  11 - aspectos importantes da oração bem sucedida
Estudo 15 11 - aspectos importantes da oração bem sucedidaJaed Gomes
 
Marcas e patentes
Marcas e patentesMarcas e patentes
Marcas e patentesbruno2m1
 
Maidan Summit 2011 - Mandira Srivastava, Isha Foundation
Maidan Summit 2011 - Mandira Srivastava, Isha FoundationMaidan Summit 2011 - Mandira Srivastava, Isha Foundation
Maidan Summit 2011 - Mandira Srivastava, Isha FoundationMaidan.in
 

Viewers also liked (20)

Search Intelligence - Social Media e Search Marketing - Proxxima 2011
Search Intelligence - Social Media e Search Marketing - Proxxima 2011Search Intelligence - Social Media e Search Marketing - Proxxima 2011
Search Intelligence - Social Media e Search Marketing - Proxxima 2011
 
Guía de análisis de fuentes
Guía de análisis de fuentesGuía de análisis de fuentes
Guía de análisis de fuentes
 
Cochrane+
Cochrane+Cochrane+
Cochrane+
 
Curso: Redes y telecomunicaciones: 06 Protocolo IPv4
Curso: Redes y telecomunicaciones: 06 Protocolo IPv4Curso: Redes y telecomunicaciones: 06 Protocolo IPv4
Curso: Redes y telecomunicaciones: 06 Protocolo IPv4
 
N tier architecture
N tier architectureN tier architecture
N tier architecture
 
6ª Manoca do Canto Gaúcho Fase Local
6ª Manoca do Canto Gaúcho Fase Local6ª Manoca do Canto Gaúcho Fase Local
6ª Manoca do Canto Gaúcho Fase Local
 
Meiosis
MeiosisMeiosis
Meiosis
 
Future in focus brazil mar2012 final
Future in focus brazil mar2012 finalFuture in focus brazil mar2012 final
Future in focus brazil mar2012 final
 
Passeioda8seriefazzendaparkhotel
Passeioda8seriefazzendaparkhotelPasseioda8seriefazzendaparkhotel
Passeioda8seriefazzendaparkhotel
 
The Cover Letter 2015
The Cover Letter 2015The Cover Letter 2015
The Cover Letter 2015
 
Presentación de la Consultoría Industrial X efficiency
Presentación de la Consultoría Industrial X efficiency Presentación de la Consultoría Industrial X efficiency
Presentación de la Consultoría Industrial X efficiency
 
Modelagem e Análise de Dados em PPC - Search Masters Brasil 2013
Modelagem e Análise de Dados em PPC - Search Masters Brasil 2013Modelagem e Análise de Dados em PPC - Search Masters Brasil 2013
Modelagem e Análise de Dados em PPC - Search Masters Brasil 2013
 
Select brands
Select brandsSelect brands
Select brands
 
Burlando win xp original
Burlando win xp originalBurlando win xp original
Burlando win xp original
 
Brand story
Brand storyBrand story
Brand story
 
Investment Funds Regime in Guernsey 21 July 2016
Investment Funds Regime in Guernsey 21 July 2016Investment Funds Regime in Guernsey 21 July 2016
Investment Funds Regime in Guernsey 21 July 2016
 
Veritas - resiliency platform
Veritas - resiliency platformVeritas - resiliency platform
Veritas - resiliency platform
 
Estudo 15 11 - aspectos importantes da oração bem sucedida
Estudo 15  11 - aspectos importantes da oração bem sucedidaEstudo 15  11 - aspectos importantes da oração bem sucedida
Estudo 15 11 - aspectos importantes da oração bem sucedida
 
Marcas e patentes
Marcas e patentesMarcas e patentes
Marcas e patentes
 
Maidan Summit 2011 - Mandira Srivastava, Isha Foundation
Maidan Summit 2011 - Mandira Srivastava, Isha FoundationMaidan Summit 2011 - Mandira Srivastava, Isha Foundation
Maidan Summit 2011 - Mandira Srivastava, Isha Foundation
 

Similar to Database Continuous Integration Ensures Code Works

Liquibase få kontroll på dina databasförändringar
Liquibase   få kontroll på dina databasförändringarLiquibase   få kontroll på dina databasförändringar
Liquibase få kontroll på dina databasförändringarSqueed
 
Sql source control
Sql source controlSql source control
Sql source controlAndyPickett
 
DevOps Drive-In: Automate Database Deployments in Your Continuous Delivery Pi...
DevOps Drive-In: Automate Database Deployments in Your Continuous Delivery Pi...DevOps Drive-In: Automate Database Deployments in Your Continuous Delivery Pi...
DevOps Drive-In: Automate Database Deployments in Your Continuous Delivery Pi...Serena Software
 
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
 
Continuous Integration and the Data Warehouse - PASS SQL Saturday Slovenia
Continuous Integration and the Data Warehouse - PASS SQL Saturday SloveniaContinuous Integration and the Data Warehouse - PASS SQL Saturday Slovenia
Continuous Integration and the Data Warehouse - PASS SQL Saturday SloveniaDr. John Tunnicliffe
 
Continuous Integration and the Data Warehouse - PASS SQL Saturday Slovenia
Continuous Integration and the Data Warehouse - PASS SQL Saturday SloveniaContinuous Integration and the Data Warehouse - PASS SQL Saturday Slovenia
Continuous Integration and the Data Warehouse - PASS SQL Saturday SloveniaDr. John Tunnicliffe
 
A data driven etl test framework sqlsat madison
A data driven etl test framework sqlsat madisonA data driven etl test framework sqlsat madison
A data driven etl test framework sqlsat madisonTerry Bunio
 
android sqlite
android sqliteandroid sqlite
android sqliteDeepa Rani
 
Denver SQL Saturday The Next Frontier
Denver SQL Saturday The Next FrontierDenver SQL Saturday The Next Frontier
Denver SQL Saturday The Next FrontierKellyn Pot'Vin-Gorman
 
Database Fundamental Concepts- Series 1 - Performance Analysis
Database Fundamental Concepts- Series 1 - Performance AnalysisDatabase Fundamental Concepts- Series 1 - Performance Analysis
Database Fundamental Concepts- Series 1 - Performance AnalysisDAGEOP LTD
 
11 Goals of High Functioning SQL Developers
11 Goals of High Functioning SQL Developers11 Goals of High Functioning SQL Developers
11 Goals of High Functioning SQL DevelopersIke Ellis
 
Саша Белецкий "Continuous Delivery в продуктовой разработке"
Саша Белецкий "Continuous Delivery в продуктовой разработке"Саша Белецкий "Continuous Delivery в продуктовой разработке"
Саша Белецкий "Continuous Delivery в продуктовой разработке"Agile Base Camp
 
Containerisation Hack of a Legacy Software Solution - Alex Carter - CodeMill ...
Containerisation Hack of a Legacy Software Solution - Alex Carter - CodeMill ...Containerisation Hack of a Legacy Software Solution - Alex Carter - CodeMill ...
Containerisation Hack of a Legacy Software Solution - Alex Carter - CodeMill ...CodeMill digital skills
 
A Continuous Delivery Safety Net for Databases
A Continuous Delivery Safety Net for DatabasesA Continuous Delivery Safety Net for Databases
A Continuous Delivery Safety Net for DatabasesIBM UrbanCode Products
 
DATABASE AUTOMATION with Thousands of database, monitoring and backup
DATABASE AUTOMATION with Thousands of database, monitoring and backupDATABASE AUTOMATION with Thousands of database, monitoring and backup
DATABASE AUTOMATION with Thousands of database, monitoring and backupSaewoong Lee
 
How to build streaming data pipelines with Akka Streams, Flink, and Spark usi...
How to build streaming data pipelines with Akka Streams, Flink, and Spark usi...How to build streaming data pipelines with Akka Streams, Flink, and Spark usi...
How to build streaming data pipelines with Akka Streams, Flink, and Spark usi...Lightbend
 

Similar to Database Continuous Integration Ensures Code Works (20)

Liquibase få kontroll på dina databasförändringar
Liquibase   få kontroll på dina databasförändringarLiquibase   få kontroll på dina databasförändringar
Liquibase få kontroll på dina databasförändringar
 
Sql source control
Sql source controlSql source control
Sql source control
 
DevOps Drive-In: Automate Database Deployments in Your Continuous Delivery Pi...
DevOps Drive-In: Automate Database Deployments in Your Continuous Delivery Pi...DevOps Drive-In: Automate Database Deployments in Your Continuous Delivery Pi...
DevOps Drive-In: Automate Database Deployments in Your Continuous Delivery Pi...
 
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
 
Copy Data Management for the DBA
Copy Data Management for the DBACopy Data Management for the DBA
Copy Data Management for the DBA
 
Continuous Integration and the Data Warehouse - PASS SQL Saturday Slovenia
Continuous Integration and the Data Warehouse - PASS SQL Saturday SloveniaContinuous Integration and the Data Warehouse - PASS SQL Saturday Slovenia
Continuous Integration and the Data Warehouse - PASS SQL Saturday Slovenia
 
Continuous Integration and the Data Warehouse - PASS SQL Saturday Slovenia
Continuous Integration and the Data Warehouse - PASS SQL Saturday SloveniaContinuous Integration and the Data Warehouse - PASS SQL Saturday Slovenia
Continuous Integration and the Data Warehouse - PASS SQL Saturday Slovenia
 
Database CI/CD Pipeline
Database CI/CD PipelineDatabase CI/CD Pipeline
Database CI/CD Pipeline
 
A data driven etl test framework sqlsat madison
A data driven etl test framework sqlsat madisonA data driven etl test framework sqlsat madison
A data driven etl test framework sqlsat madison
 
android sqlite
android sqliteandroid sqlite
android sqlite
 
Denver SQL Saturday The Next Frontier
Denver SQL Saturday The Next FrontierDenver SQL Saturday The Next Frontier
Denver SQL Saturday The Next Frontier
 
Ow
OwOw
Ow
 
Database Fundamental Concepts- Series 1 - Performance Analysis
Database Fundamental Concepts- Series 1 - Performance AnalysisDatabase Fundamental Concepts- Series 1 - Performance Analysis
Database Fundamental Concepts- Series 1 - Performance Analysis
 
Sql saturday oc 2019
Sql saturday oc 2019Sql saturday oc 2019
Sql saturday oc 2019
 
11 Goals of High Functioning SQL Developers
11 Goals of High Functioning SQL Developers11 Goals of High Functioning SQL Developers
11 Goals of High Functioning SQL Developers
 
Саша Белецкий "Continuous Delivery в продуктовой разработке"
Саша Белецкий "Continuous Delivery в продуктовой разработке"Саша Белецкий "Continuous Delivery в продуктовой разработке"
Саша Белецкий "Continuous Delivery в продуктовой разработке"
 
Containerisation Hack of a Legacy Software Solution - Alex Carter - CodeMill ...
Containerisation Hack of a Legacy Software Solution - Alex Carter - CodeMill ...Containerisation Hack of a Legacy Software Solution - Alex Carter - CodeMill ...
Containerisation Hack of a Legacy Software Solution - Alex Carter - CodeMill ...
 
A Continuous Delivery Safety Net for Databases
A Continuous Delivery Safety Net for DatabasesA Continuous Delivery Safety Net for Databases
A Continuous Delivery Safety Net for Databases
 
DATABASE AUTOMATION with Thousands of database, monitoring and backup
DATABASE AUTOMATION with Thousands of database, monitoring and backupDATABASE AUTOMATION with Thousands of database, monitoring and backup
DATABASE AUTOMATION with Thousands of database, monitoring and backup
 
How to build streaming data pipelines with Akka Streams, Flink, and Spark usi...
How to build streaming data pipelines with Akka Streams, Flink, and Spark usi...How to build streaming data pipelines with Akka Streams, Flink, and Spark usi...
How to build streaming data pipelines with Akka Streams, Flink, and Spark usi...
 

More from Red Gate Software

Embracing DevOps through database migrations with Flyway
Embracing DevOps through database migrations with FlywayEmbracing DevOps through database migrations with Flyway
Embracing DevOps through database migrations with FlywayRed Gate Software
 
Database DevOps for Managed Service Providers
Database DevOps for Managed Service ProvidersDatabase DevOps for Managed Service Providers
Database DevOps for Managed Service ProvidersRed Gate Software
 
Mizuho Financial: Launching our Database DevOps journey
Mizuho Financial: Launching our Database DevOps journeyMizuho Financial: Launching our Database DevOps journey
Mizuho Financial: Launching our Database DevOps journeyRed Gate Software
 
7 steps to effective SQL Server monitoring
7 steps to effective SQL Server monitoring7 steps to effective SQL Server monitoring
7 steps to effective SQL Server monitoringRed Gate Software
 
Level up your deployments for SQL Source Control
Level up your deployments for SQL Source Control Level up your deployments for SQL Source Control
Level up your deployments for SQL Source Control Red Gate Software
 
Key findings from the 2020 state of database dev ops report
Key findings from the 2020 state of database dev ops reportKey findings from the 2020 state of database dev ops report
Key findings from the 2020 state of database dev ops reportRed Gate Software
 
Extend DevOps to Your SQL Server Databases
Extend DevOps to Your SQL Server DatabasesExtend DevOps to Your SQL Server Databases
Extend DevOps to Your SQL Server DatabasesRed Gate Software
 
What we learned at PASS Summit in 2019
What we learned at PASS Summit in 2019What we learned at PASS Summit in 2019
What we learned at PASS Summit in 2019Red Gate Software
 
Quality in Software Development: Anglia Ruskin University
Quality in Software Development: Anglia Ruskin UniversityQuality in Software Development: Anglia Ruskin University
Quality in Software Development: Anglia Ruskin UniversityRed Gate Software
 
How SQL Change Automation helps you deliver value faster
How SQL Change Automation helps you deliver value fasterHow SQL Change Automation helps you deliver value faster
How SQL Change Automation helps you deliver value fasterRed Gate Software
 
DevOps essentials from Abel Wang and Steve Jones
DevOps essentials from Abel Wang and Steve JonesDevOps essentials from Abel Wang and Steve Jones
DevOps essentials from Abel Wang and Steve JonesRed Gate Software
 
The Ultimate Guide to Choosing and Implementing the Right Monitoring Tool
The Ultimate Guide to Choosing and Implementing the Right Monitoring ToolThe Ultimate Guide to Choosing and Implementing the Right Monitoring Tool
The Ultimate Guide to Choosing and Implementing the Right Monitoring ToolRed Gate Software
 
Everything You Need to Know About the 2019 DORA Accelerate State of DevOps Re...
Everything You Need to Know About the 2019 DORA Accelerate State of DevOps Re...Everything You Need to Know About the 2019 DORA Accelerate State of DevOps Re...
Everything You Need to Know About the 2019 DORA Accelerate State of DevOps Re...Red Gate Software
 
Using Redgate, AKS and Azure to bring DevOps to your database
Using Redgate, AKS and Azure to bring DevOps to your databaseUsing Redgate, AKS and Azure to bring DevOps to your database
Using Redgate, AKS and Azure to bring DevOps to your databaseRed Gate Software
 
How to Pitch a Software Development Initiative and Ignite Culture Change
How to Pitch a Software Development Initiative and Ignite Culture ChangeHow to Pitch a Software Development Initiative and Ignite Culture Change
How to Pitch a Software Development Initiative and Ignite Culture ChangeRed Gate Software
 
Standardize Database Development Across your Organization in 4 Key Steps
Standardize Database Development Across your Organization in 4 Key StepsStandardize Database Development Across your Organization in 4 Key Steps
Standardize Database Development Across your Organization in 4 Key StepsRed Gate Software
 
Data Privacy Next Steps -Compliant Database DevOps
Data Privacy Next Steps -Compliant Database DevOpsData Privacy Next Steps -Compliant Database DevOps
Data Privacy Next Steps -Compliant Database DevOpsRed Gate Software
 
Easing the transition from shared to dedicated database development
Easing the transition from shared to dedicated database developmentEasing the transition from shared to dedicated database development
Easing the transition from shared to dedicated database developmentRed Gate Software
 

More from Red Gate Software (20)

Embracing DevOps through database migrations with Flyway
Embracing DevOps through database migrations with FlywayEmbracing DevOps through database migrations with Flyway
Embracing DevOps through database migrations with Flyway
 
Database DevOps for Managed Service Providers
Database DevOps for Managed Service ProvidersDatabase DevOps for Managed Service Providers
Database DevOps for Managed Service Providers
 
Mizuho Financial: Launching our Database DevOps journey
Mizuho Financial: Launching our Database DevOps journeyMizuho Financial: Launching our Database DevOps journey
Mizuho Financial: Launching our Database DevOps journey
 
7 steps to effective SQL Server monitoring
7 steps to effective SQL Server monitoring7 steps to effective SQL Server monitoring
7 steps to effective SQL Server monitoring
 
Level up your deployments for SQL Source Control
Level up your deployments for SQL Source Control Level up your deployments for SQL Source Control
Level up your deployments for SQL Source Control
 
Key findings from the 2020 state of database dev ops report
Key findings from the 2020 state of database dev ops reportKey findings from the 2020 state of database dev ops report
Key findings from the 2020 state of database dev ops report
 
Extend DevOps to Your SQL Server Databases
Extend DevOps to Your SQL Server DatabasesExtend DevOps to Your SQL Server Databases
Extend DevOps to Your SQL Server Databases
 
2019 year in review slides
2019 year in review slides2019 year in review slides
2019 year in review slides
 
What we learned at PASS Summit in 2019
What we learned at PASS Summit in 2019What we learned at PASS Summit in 2019
What we learned at PASS Summit in 2019
 
Quality in Software Development: Anglia Ruskin University
Quality in Software Development: Anglia Ruskin UniversityQuality in Software Development: Anglia Ruskin University
Quality in Software Development: Anglia Ruskin University
 
How SQL Change Automation helps you deliver value faster
How SQL Change Automation helps you deliver value fasterHow SQL Change Automation helps you deliver value faster
How SQL Change Automation helps you deliver value faster
 
DevOps essentials from Abel Wang and Steve Jones
DevOps essentials from Abel Wang and Steve JonesDevOps essentials from Abel Wang and Steve Jones
DevOps essentials from Abel Wang and Steve Jones
 
The Ultimate Guide to Choosing and Implementing the Right Monitoring Tool
The Ultimate Guide to Choosing and Implementing the Right Monitoring ToolThe Ultimate Guide to Choosing and Implementing the Right Monitoring Tool
The Ultimate Guide to Choosing and Implementing the Right Monitoring Tool
 
Everything You Need to Know About the 2019 DORA Accelerate State of DevOps Re...
Everything You Need to Know About the 2019 DORA Accelerate State of DevOps Re...Everything You Need to Know About the 2019 DORA Accelerate State of DevOps Re...
Everything You Need to Know About the 2019 DORA Accelerate State of DevOps Re...
 
Using Redgate, AKS and Azure to bring DevOps to your database
Using Redgate, AKS and Azure to bring DevOps to your databaseUsing Redgate, AKS and Azure to bring DevOps to your database
Using Redgate, AKS and Azure to bring DevOps to your database
 
How to Pitch a Software Development Initiative and Ignite Culture Change
How to Pitch a Software Development Initiative and Ignite Culture ChangeHow to Pitch a Software Development Initiative and Ignite Culture Change
How to Pitch a Software Development Initiative and Ignite Culture Change
 
Taming the Wild West
Taming the Wild West Taming the Wild West
Taming the Wild West
 
Standardize Database Development Across your Organization in 4 Key Steps
Standardize Database Development Across your Organization in 4 Key StepsStandardize Database Development Across your Organization in 4 Key Steps
Standardize Database Development Across your Organization in 4 Key Steps
 
Data Privacy Next Steps -Compliant Database DevOps
Data Privacy Next Steps -Compliant Database DevOpsData Privacy Next Steps -Compliant Database DevOps
Data Privacy Next Steps -Compliant Database DevOps
 
Easing the transition from shared to dedicated database development
Easing the transition from shared to dedicated database developmentEasing the transition from shared to dedicated database development
Easing the transition from shared to dedicated database development
 

Recently uploaded

Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
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
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
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
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
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
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
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
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
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
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
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
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 

Recently uploaded (20)

Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
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
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
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...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
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
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
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
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
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
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 

Database Continuous Integration Ensures Code Works

  • 1. #sqlinthecity Automated Build and Test (or continuous integration) (for your database) David Atkinson Product Manager, Red Gate David.Atkinson@red-gate.com
  • 2. #sqlinthecity What will we cover today? Database build automation: What, Why, How Practical Demo Questions encouraged!
  • 3. #sqlinthecity Show of hands: How agile is your database development? 1. Database objects/scripts aren’t in version control 2. Database objects/scripts are in version control 3. An automated build system exists to build and test the database 4. An automated release system is used to promote your database to your environments
  • 4. #sqlinthecity How agile is your database development? 1. Database objects/scripts aren’t in version control 2. Database objects/scripts are in version control 3. An automated build system exists to build and test the database 4. An automated release system is used to promote your database to your environments
  • 5. #sqlinthecity What is continuous integration? “Continuous Integration is a practice designed to ensure that your software is always working, and that you get comprehensive feedback in a few minutes as to whether any given change to your system has broken it.” Jez Humble, ThoughtWorks, author of “Continuous Delivery”
  • 6. database #sqlinthecity What is continuous integration? ^ “Database Continuous Integration is a practice designed to ensure that your database software is always working, and that you get comprehensive feedback in a few minutes as to whether any given change to your system has broken it.”
  • 8. #sqlinthecity What is build? • For application code = compile • For database code = database creation script – But only for a new installation! • Upgrade scripts required for existing installations – Need to preserve the state of the data
  • 9. #sqlinthecity What is test? • For .NET code, NUnit. – Runs on a developer’s machine and build server • What about the database? – tSQLt is an open source framework for testing SQL Server databases – SQL Test provides SSMS integration
  • 10. #sqlinthecity Demo background Two fictional developers, David and Grant, are working on the website, www.simpletalk.com, a community website for .NET and SQL Server developers The application comprises • An ASP.Net web application • A SQL Server database
  • 11. #sqlinthecity Demo background Continuous integration has been configured to: 1. Keep a test database up to date with the latest changes 2. Run automated tSQLt tests (on realistic amounts of data) 3. Generate up-to-date documentation 4. Generate deployment scripts
  • 12. #sqlinthecity Demo background A few improvements are being made to Simple Talk. These changes will be deployed to production. But… only when the dev team has demonstrated that the changes work!
  • 13. #sqlinthecity Tools used • TeamCity (CI tool from JetBrains) • SQL Automation Pack (includes TeamCity plugin) • Glimpse (open source) From the SQL Developer Bundle: • • • • SQL Source Control SQL Test (tSQLt unit testing framework) SQL Data Generator SQL Doc
  • 15. Custom Migration Scripts An introduction #sqlinthecity
  • 17. #sqlinthecity How changes are made create table modify procedure 1 2 3 delete column create trigger drop view 4 5 6
  • 18. #sqlinthecity How changes are made create table modify procedure 1 2 modify trigger create function 7 3 drop procedure 8 4 10 6 5 create view modify function 9 delete column create trigger drop view create procedure 11 12
  • 19. #sqlinthecity How SQL Compare sees the world 1 12
  • 20. #sqlinthecity But not all changes can be inferred 1 2 3 5 column rename merge table 8 merge column split column 9 6 add NOT NULL column without DEFAULT table rename split table 7 4 10 11 data transformation data motion 12
  • 21. #sqlinthecity SQL Compare and SQL Source Control support custom migration scripts 1 2 3 4 5 6 11 12 Custom migration script 7 8 9 10
  • 22. #sqlinthecity Deployment script with migration scripts 1 12
  • 25. #sqlinthecity Recap: database CI 1. Incrementally keeps a test database up to date 2. Runs tSQLt tests on a database with realistic amounts of data 3. Generates always-up-to-date documentation 4. Generates and validates deployment scripts 5. Publishes a Deployment Manager database package
  • 26. #sqlinthecity Recap of demo: writing a test 1. 2. 3. 4. 5. A new test is added Continuous Integration identifies a failure We reproduce the bug locally We fix the bug and test it We commit the fix to source control
  • 27. #sqlinthecity Recap: migration scripts 1. The fix sets the [PublishDate] column from NULL to NOT NULL 2. Grant’s “get latest” fails because existing data that has NULL values 3. The continuous integration build alerts us of the same issue 4. A migration script is added to UPDATE existing data prior to changing the column to NOT NULL 5. Get Latest becomes possible and the continuous integration build once again indicates working software
  • 28. #sqlinthecity Latest version at : www.red-gate.com/CI David.Atkinson@red-gate.com Questions?

Editor's Notes

  1. Self-categorize
  2. CI server is set up by one person and the whole team of developers benefits.
  3. The testing of deployment scripts is customarily left to the end. => Issues with upgrades only found at the end of a project.
  4. Although CI catches issues that arise when developers have failed run tests locally, also solving a different problem:- Two incompatible changes committed by different developers- “Works on my machine” in development.Issues that only arise in more realistic integration environments.
  5. Show of hands for SQL Developer Bundle.TeamCity is used at Red Gate but *any* build server can be used, eg:Jenkins, Hudson, TFS Build, CruiseControl, Bamboo, etc.There is a sqlci.exe command line, and NAnt and MSBuild template wrappers available.