SlideShare a Scribd company logo
@_AlexYates_
#SQLLeeds
Getting CI right for SQL Server
Alex Yates
@_AlexYates_
#SQLLeeds
DLM Consultant
workingwithdevs.com
alex.yates@dlmconsultants.com
AlexYates
@_AlexYates_
@_AlexYates_
#SQLLeeds
@_AlexYates_ | #SQLLeeds
@_AlexYates_
#SQLLeeds
Agile
Scrum
Lean
DevOps
Iterative
Continuous Delivery
Developers
@_AlexYates_
#SQLLeeds
Monitoring
Deployment
Integrity
Performance
DBAs
@_AlexYates_
#SQLLeeds
@_AlexYates_
#SQLLeeds
Woah! Deployment fail?
@_AlexYates_
#SQLLeeds
#worksOnMyMachine
Woah! Deployment fail?
@_AlexYates_
#SQLLeeds
A cursor?! You just CAN’T do that?!
@_AlexYates_
#SQLLeeds
#worksOnMyMachine
A cursor?! You just CAN’T do that?!
@_AlexYates_
#SQLLeeds
Hey, you just dropped my hot-fix!
@_AlexYates_
#SQLLeeds
#worksOnMyMachine
Hey, you just dropped my hot-fix!
@_AlexYates_
#SQLLeeds
What is CI?
@_AlexYates_
#SQLLeeds
What is CI?
Continuous Integration (CI) is a development practice that
requires developers to integrate code into a shared repository
several times a day.
Each check-in is then verified by an automated build, allowing
teams to detect problems early.
www.thoughtworks.com/continuous-integration
@_AlexYates_
#SQLLeeds
Farm Credit Services of America (FCSA)
• 100 person IT team, 14 sub-teams
• Database version control inconsistent
• Deployment process manual
• Delivery was slow and unreliable
@_AlexYates_
#SQLLeeds
Farm Credit Services of America (FCSA)
• Deployments easier to review
• Delivery faster and more reliable
• Standardised source control and delivery process
• Automated manual deployment tasks
@_AlexYates_
#SQLLeeds
The deployment pipeline
@_AlexYates_
#SQLLeeds
Databases are hard
• Schema changes vs existing data
• Reference data vs production data
• Teamwork and testing
• Database drift (change outside
process, e.g. production hot-fixes)
@_AlexYates_
#SQLLeeds
The deployment pipeline
@_AlexYates_
#SQLLeeds
Agenda
Version control
Model vs migrations
Automated builds
Unit testing
Drift
General advice
@_AlexYates_
#SQLLeeds
Agenda
Version control
Model vs migrations
Automated builds
Unit testing
Drift
General advice
@_AlexYates_
#SQLLeeds
Version Control
@_AlexYates_
#SQLLeeds
Version control - LMGTFY
@_AlexYates_
#SQLLeeds
Agenda
Version control
Model vs migrations
Automated builds
Unit testing
Drift
General advice
@_AlexYates_
#SQLLeeds
Agenda
Version control
Model vs migrations
Automated builds
Unit testing
Drift
General advice
@_AlexYates_
#SQLLeeds
There’s
more than
one way to
skin a cat
@_AlexYates_
#SQLLeeds
There’s
more than
one way to
skin
automate
a cat
@_AlexYates_
#SQLLeeds
V1 V2
@_AlexYates_
#SQLLeeds
V1 V2
Migrations-based solutions
@_AlexYates_
#SQLLeeds
V1 V2
State-based solutions
@_AlexYates_
#SQLLeeds
@_AlexYates_
#SQLLeeds
“There's nothing more
reliable than keeping
track of exactly the
scripts you intend to run,
and running them, without
trying to compare state
and guess.”
@_AlexYates_
#SQLLeeds
“There's nothing more
reliable than keeping
track of exactly the
scripts you intend to run,
and running them, without
trying to compare state
and guess.”
Paul Stovell,
built Octopus Deploy
http://docs.octopusdeploy.com/display/OD/SQL+Server+databases
@_AlexYates_
#SQLLeeds
“As soon as you have
multiple changes on a
single aspect of an object,
ordering and the ability to
detect which change
needs to be made gets
very complicated.”
@_AlexYates_
#SQLLeeds
“As soon as you have
multiple changes on a
single aspect of an object,
ordering and the ability to
detect which change
needs to be made gets
very complicated.”
Gert Drapers,
built DataDude
https://blogs.msdn.microsoft.com/gertd/2009/06/05/declarative-database-development/
@_AlexYates_
#SQLLeeds
Migrations vs state
http://workingwithdevs.com/delivering-databases-migrations-vs-state/
@_AlexYates_
#SQLLeeds
Migrations vs state
http://workingwithdevs.com/delivering-databases-migrations-vs-state/
@_AlexYates_
#SQLLeeds
Migrations vs state
http://workingwithdevs.com/delivering-databases-migrations-vs-state/
@_AlexYates_
#SQLLeeds
Migrations vs state
http://workingwithdevs.com/delivering-databases-migrations-vs-state/
@_AlexYates_
#SQLLeeds
Migrations vs state
http://workingwithdevs.com/delivering-databases-migrations-vs-state/
@_AlexYates_
#SQLLeeds
Migrations vs state
http://workingwithdevs.com/delivering-databases-migrations-vs-state/
@_AlexYates_
#SQLLeeds
Migrations vs state
http://workingwithdevs.com/delivering-databases-migrations-vs-state/
@_AlexYates_
#SQLLeeds
State
 Easier (less control)
 Better for sprocs/functions
 Better for large/distributed
teams
 Better for frequent changes
 Better for dependency
nightmares
 Drift: rolled back
 Better for development
Migrations
 More control (harder/needs
discipline)
 Better for data migrations
 Better for small teams
 Better for infrequent
changes
 Better for simple data stores
 Drift: ignored
 Better for automation
VS
@_AlexYates_
#SQLLeeds
DLMConsultants.com/model-vs-mig
@_AlexYates_
#SQLLeeds
Demo
@_AlexYates_
#SQLLeeds
Agenda
Version control
Model vs migrations
Automated builds
Unit testing
Drift
General advice
@_AlexYates_
#SQLLeeds
Agenda
Version control
Model vs migrations
Automated builds
Unit testing
Drift
General advice
@_AlexYates_
#SQLLeeds
Automated builds
@_AlexYates_
#SQLLeeds
VCS Build Test Sync
Upgrade scriptDatabase
package
Test
results
The automated build process
@_AlexYates_
#SQLLeeds
http://www.jamesshore.com/Blog/Continuous-Integration-on-a-Dollar-a-Day.html
@_AlexYates_
#SQLLeeds
Build servers
@_AlexYates_
#SQLLeeds
Builds/Tests
are run on
CI agents
Builds/Tests are
managed on
CI server
CI
server
How do build servers work?
@_AlexYates_
#SQLLeeds
Demo
@_AlexYates_
#SQLLeeds
Agenda
Version control
Model vs migrations
Automated builds
Unit testing
Drift
General advice
@_AlexYates_
#SQLLeeds
Agenda
Version control
Model vs migrations
Automated builds
Unit testing
Drift
General advice
@_AlexYates_
#SQLLeeds
Unit testing
@_AlexYates_
#SQLLeeds
Unit testing
www.tsqlt.org
@_AlexYates_
#SQLLeeds
Unit testing
www.tsqlt.org
@_AlexYates_
#SQLLeeds
Unit testing
www.tsqlt.org
@_AlexYates_
#SQLLeeds
www.tsqlt.org
Unit testing
@_AlexYates_
#SQLLeeds
Unit testing
@_AlexYates_
#SQLLeeds
Unit testing
@_AlexYates_
#SQLLeeds
http://workingwithdevs.com/three-odd-attitudes-towards-database-unit-testing-that-make-me-angry/
@_AlexYates_
#SQLLeeds
Demo
@_AlexYates_
#SQLLeeds
Agenda
Version control
Model vs migrations
Automated builds
Unit testing
Drift
General advice
@_AlexYates_
#SQLLeeds
Agenda
Version control
Model vs migrations
Automated builds
Unit testing
Drift
General advice
@_AlexYates_
#SQLLeeds
Drift
@_AlexYates_
#SQLLeeds
@_AlexYates_
#SQLLeeds
“When making changes
directly on production, you are
making a decision that the
delay due to poor cycle time is
more expensive than the risk of
making a mistake.”
@_AlexYates_
#SQLLeeds
“When making changes
directly on production, you are
making a decision that the
delay due to poor cycle time is
more expensive than the risk of
making a mistake.”
AlexYates,
built this slide
@_AlexYates_
#SQLLeeds
The bad stuff:
• Accidental roll-backs
(state)
• Failed deployments
(migrations)
• Environment inconsistency
(migrations)
@_AlexYates_
#SQLLeeds
Drift
Strategies to help
 Improve cycle time
 Strict security policies
 Monitor drift (play with DDL
triggers)
 Redgate DLM Dashboard (free)
https://www.simple-talk.com/sql/database-administration/database-deployment-the-bits-database-version-drift/
@_AlexYates_
#SQLLeeds
Drift
Strategies to help
 Improve cycle time
 Strict security policies
 Monitor drift (play with DDL
triggers)
 Redgate DLM Dashboard (free)
http://www.red-gate.com/products/dlm/dlm-dashboard/
@_AlexYates_
#SQLLeeds
Demo
@_AlexYates_
#SQLLeeds
Agenda
Version control
Model vs migrations
Automated builds
Unit testing
Drift
General advice
@_AlexYates_
#SQLLeeds
Agenda
Version control
Model vs migrations
Automated builds
Unit testing
Drift
General advice
@_AlexYates_
#SQLLeeds
• Don’t do *all the things* at once - start with VCS and drift, then CI, then
RM
• Don’t forget tests
• Teamwork above tools/process
• Keep Branching simple… especially if you aren’t using a DVCS
• Decouple database deployments from other systems
• Use the right process/tool for your database and team
• Ask me for help!
General advice
@_AlexYates_
#SQLLeeds
Agenda
Version control
Model vs migrations
Automated builds
Unit testing
Drift
General advice
@_AlexYates_
#SQLLeeds
• Standardised VCS, CI and RM processes
• FCSA delivering much more efficiently
• FCSA process model for sister organisations
• The team all have excellent CV’s
Farm Credit Services of America (FCSA)
@_AlexYates_
#SQLLeeds
• Standardised VCS, CI and RM processes
• FCSA delivering much more efficiently
• FCSA process model for sister organisations
• The team all have excellent CV’s
Farm Credit Services of America (FCSA)
http://www.codeaperture.io/2016/09/13/how-redgate-helped-define-our-process/
Getting CI right for SQL Server
@_AlexYates_
#SQLLeeds
Siloed sparrows suck at DLM
@_AlexYates_
#SQLLeeds
Heated hippos are closed minded
@_AlexYates_
#SQLLeeds
State
 Easier (less control)
 Better for sprocs/functions
 Better for large/distributed
teams
 Better for frequent changes
 Better for dependency
nightmares
 Drift: rolled back
 Better for development
Migrations
 More control (harder/needs
discipline)
 Better for data migrations
 Better for small teams
 Better for infrequent
changes
 Better for simple data stores
 Drift: ignored
 Better for automation
VS
Clever people consider options
@_AlexYates_
#SQLLeeds
Use appropriate tools
@_AlexYates_
#SQLLeeds
Only hire developers who write tests
@_AlexYates_
#SQLLeeds
Hunt his smug face - make pain on it
@_AlexYates_
#SQLLeeds
This stuff makes a big difference
http://www.codeaperture.io/2016/09/13/how-redgate-helped-define-our-process/
@_AlexYates_
#SQLLeeds
DLMConsultants.com/ci
Getting CI right for SQL Server
@_AlexYates_
#SQLLeeds
Questions?
Links: DLMConsultants.com/ci
Contact me: alex.yates@dlmconsultants.com
@_AlexYates_
#SQLLeeds
Image sources
Author Source Information
Chiltepinster Wikimedia Commons Mocking Bird Argument.jpg – Wikimedia Commons. This file is licensed under the Creative Commons Attribution-Share
Alike 3.0 Unported license. Source on Wikimedia Commons: “Own work”
Bit Boy Flickr The elephant in the room – Flickr. This file is licensed under the Creative Commons Attribution 2.0 Generic license.
Nils Rinaldi Flickr Hippo fight 2/3 – Flickr. This file is licensed under the Creative Commons Attribution 2.0 Generic license.
My own collection Taken by/property of Alex Yates Kitten, “There’s more than one way to skin a cat!”
Memegenerator.net Memegenerator.net I don’t always edit database. Content designed to be shared and delivered with credit to memegenerator.net.
Ctrl.Alt.Design ctrla.lt Social Media share icons

More Related Content

PDF
Indexes: The neglected performance all rounder
PPTX
Agile Data Warehousing
PPSX
React introduction
PPTX
SSIS Monitoring Deep Dive
PDF
Java WebStart Is Dead: What Should We Do Now?
PPTX
11 Goals of High Functioning SQL Developers
PPTX
Debugging made easier with extended events
PPTX
AlwaysOn Troubleshooting Improvements
Indexes: The neglected performance all rounder
Agile Data Warehousing
React introduction
SSIS Monitoring Deep Dive
Java WebStart Is Dead: What Should We Do Now?
11 Goals of High Functioning SQL Developers
Debugging made easier with extended events
AlwaysOn Troubleshooting Improvements

What's hot (19)

PPTX
Database deployment: still hard after all these years - Data Saturday #1
PPTX
Salesforce Flows Architecture Best Practices
PDF
How would ESBs look like, if they were done today.
PDF
Continuously Integrating Distributed Code at Netflix
PPTX
DOES SFO 2016 - Chris Fulton - CD for DBs
PPTX
DOES SFO 2016 - Avan Mathur - Planning for Huge Scale
PDF
Strategies to edit production data
PPTX
Always On Availability Group Troubleshooting Ninja
PPTX
Untying the Knots of Web Dev with Internet Explorer
PPTX
2016 Mastering SAP Tech - 2 Speed IT and lessons from an Agile Waterfall eCom...
PDF
Add Some DDD to Your ASP.NET MVC, OK?
PDF
Michael North "Ember.js 2 - Future-friendly ambitious apps, that scale!"
PPTX
Elm - Could this be the Future of Web Dev?
PDF
Introduction to react
PDF
Building Modern Web Applications using React and Redux
PDF
Developing, building, testing and deploying react native apps
PDF
Real World Java 9
PDF
Deployment Flexibility: Introducing Support for Microsoft Azure
PDF
The databases in SSDT: A work with project and best practices
Database deployment: still hard after all these years - Data Saturday #1
Salesforce Flows Architecture Best Practices
How would ESBs look like, if they were done today.
Continuously Integrating Distributed Code at Netflix
DOES SFO 2016 - Chris Fulton - CD for DBs
DOES SFO 2016 - Avan Mathur - Planning for Huge Scale
Strategies to edit production data
Always On Availability Group Troubleshooting Ninja
Untying the Knots of Web Dev with Internet Explorer
2016 Mastering SAP Tech - 2 Speed IT and lessons from an Agile Waterfall eCom...
Add Some DDD to Your ASP.NET MVC, OK?
Michael North "Ember.js 2 - Future-friendly ambitious apps, that scale!"
Elm - Could this be the Future of Web Dev?
Introduction to react
Building Modern Web Applications using React and Redux
Developing, building, testing and deploying react native apps
Real World Java 9
Deployment Flexibility: Introducing Support for Microsoft Azure
The databases in SSDT: A work with project and best practices
Ad

Viewers also liked (16)

PPTX
Tribunales de trabajo
PPT
Chpt 12 1
PDF
エンゲージメント・フォーラム
PPTX
Teorías organizativas
PPTX
Introduction
PDF
Field Recruitment Skills Testing Brochure
PPTX
Importancia del estudio del derecho adjetivo procesal laboral
PPTX
IntrIntroduction
DOC
Kỹ năng mềm
PPTX
The use of articles in english.
PPT
requirements analysis and design
PPTX
Getting CI right for SQL Server
PPTX
DevOps 101 for data professionals
PPTX
Scm multimoda firman Bp3ip trisakti
PDF
Katalog Oriflame Januari 2017 Indonesia
PDF
Katalog Oriflame Februari 2017 Indonesia
Tribunales de trabajo
Chpt 12 1
エンゲージメント・フォーラム
Teorías organizativas
Introduction
Field Recruitment Skills Testing Brochure
Importancia del estudio del derecho adjetivo procesal laboral
IntrIntroduction
Kỹ năng mềm
The use of articles in english.
requirements analysis and design
Getting CI right for SQL Server
DevOps 101 for data professionals
Scm multimoda firman Bp3ip trisakti
Katalog Oriflame Januari 2017 Indonesia
Katalog Oriflame Februari 2017 Indonesia
Ad

Similar to Getting CI right for SQL Server (20)

PPTX
DevOps 101 for data professionals
PPTX
Getting Release Management Right for SQL Server
PPTX
IndyCodeCamp SDS May 16th 2009
PPTX
SQL Bits: Containers and Clones
PPTX
Ed Elliott - Practical DSC in Azure
PPTX
DevOpsDays SLC - Getting Along With Your DBOps Team
PPTX
Adopting DLM at Greentube
PPTX
[ENG] Sql Saturday 355 in Parma - New "SQL Server databases under source cont...
PPTX
Migrating on premises workload to azure sql database
PPTX
Migrate Access to SQL Server/Azure
PPTX
Copy Data Management for the DBA
PPTX
My 2019 SQL Saturday In San Diego presentation
PPTX
Sql source control
PPTX
Database automated build and test - SQL In The City Cambridge
PDF
SQL Server 2008 Migration
PDF
SQLSaturday#290_Kiev_WindowsAzureDatabaseForBeginners
PDF
SQL Server Integration Services – Enterprise Manageability
DOCX
Satwinder SQL.SSK_Brd_2015
PDF
Accelerating SQL to NoSQL Migration WP - LTIMindtree
PDF
Mstr meetup
DevOps 101 for data professionals
Getting Release Management Right for SQL Server
IndyCodeCamp SDS May 16th 2009
SQL Bits: Containers and Clones
Ed Elliott - Practical DSC in Azure
DevOpsDays SLC - Getting Along With Your DBOps Team
Adopting DLM at Greentube
[ENG] Sql Saturday 355 in Parma - New "SQL Server databases under source cont...
Migrating on premises workload to azure sql database
Migrate Access to SQL Server/Azure
Copy Data Management for the DBA
My 2019 SQL Saturday In San Diego presentation
Sql source control
Database automated build and test - SQL In The City Cambridge
SQL Server 2008 Migration
SQLSaturday#290_Kiev_WindowsAzureDatabaseForBeginners
SQL Server Integration Services – Enterprise Manageability
Satwinder SQL.SSK_Brd_2015
Accelerating SQL to NoSQL Migration WP - LTIMindtree
Mstr meetup

Recently uploaded (20)

PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
KodekX | Application Modernization Development
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
cuic standard and advanced reporting.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
Big Data Technologies - Introduction.pptx
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Machine learning based COVID-19 study performance prediction
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPT
Teaching material agriculture food technology
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Electronic commerce courselecture one. Pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
KodekX | Application Modernization Development
Dropbox Q2 2025 Financial Results & Investor Presentation
Diabetes mellitus diagnosis method based random forest with bat algorithm
Per capita expenditure prediction using model stacking based on satellite ima...
cuic standard and advanced reporting.pdf
Chapter 3 Spatial Domain Image Processing.pdf
Big Data Technologies - Introduction.pptx
MIND Revenue Release Quarter 2 2025 Press Release
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Programs and apps: productivity, graphics, security and other tools
Machine learning based COVID-19 study performance prediction
NewMind AI Weekly Chronicles - August'25 Week I
Teaching material agriculture food technology
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Electronic commerce courselecture one. Pdf
The AUB Centre for AI in Media Proposal.docx
20250228 LYD VKU AI Blended-Learning.pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf

Getting CI right for SQL Server