SlideShare a Scribd company logo
1 of 28
Download to read offline
#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

2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...BookNet Canada
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Karmanjay Verma
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxAna-Maria Mihalceanu
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...itnewsafrica
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
All These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFAll These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFMichael Gough
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Mark Simos
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 

Recently uploaded (20)

2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance Toolbox
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
All These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFAll These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDF
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 

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.