This document summarizes a presentation about getting continuous integration (CI) right for SQL Server databases. It discusses the speaker's experience helping Farm Credit Services of America standardize their version control, CI, and release management processes. Key topics covered include using migrations vs state-based approaches for database changes, setting up automated builds, implementing database unit testing, addressing drift between environments, and general advice. The presentation provides examples and recommendations to help teams set up CI for databases more efficiently.
4. @_AlexYates_
#ManSSUG
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
6. @_AlexYates_
#ManSSUG
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
8. @_AlexYates_
#ManSSUG
Farm Credit Services of America (FCSA)
• Growing test suite
• Delivery faster and more reliable
• Standardised source control process
• Automated builds/deploys from source control
10. @_AlexYates_
#ManSSUG
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)
25. @_AlexYates_
#ManSSUG
“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
26. @_AlexYates_
#ManSSUG
“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.”
27. @_AlexYates_
#ManSSUG
“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/
35. @_AlexYates_
#ManSSUG
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
61. @_AlexYates_
#ManSSUG
“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
68. @_AlexYates_
#ManSSUG
• Teamwork above tools/process
• Don’t do *all the things* at once - start with VCS and drift
• Don’t forget tests
• Decouple database from other systems
• Learn CI on an easy database/project
• Use the right process/tool for your database and team
• Ask me for help!
General advice
70. @_AlexYates_
#ManSSUG
• 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)
71. @_AlexYates_
#ManSSUG
• 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/
75. @_AlexYates_
#ManSSUG
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
83. @_AlexYates_
#ManSSUG
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