The secret to pain-free database
deployments? Automation (yes, really)
David Atkinson
Product Strategy
Red Gate
David.Atkinson@red-gate.com
@dtabase
Continuous delivery for databases
Grant Fritchey
Product Evangelist
Red Gate
grant@scarydba.com
@GFritchey
Goals
 Evolution of database deployments
 How automation has solved release problems
 Evolve your own pipeline
Database Delivery
It’s about automating to Production.
In fact –
there’s a difference between three continuous approaches:
Development
Source
control CI server Test Production
Continuous integration
Continuous deployment
Continuous delivery
Release
pipeline
Databases as a bottleneck – historically
Odd languages
 SQL
 Cubes
 X-Query
3 reasons why databases have traditionally slowed down
deployments:
Data persistence
 Data outlives
applications
 Data can’t be
replaced
DBA paranoia
 Frankly…
1 2 3
So what’s changed?
Tools, techniques and processes…
Getting your database
under version control is easier
Lean and agile are more
frequently used in software delivery
We’re learning from the ALM space
on pipeline building
The goals of continuous delivery for databases
 Faster feedback on changes made
o Continuously integrate team changes
o Automated testing
o Releases rehearsed in testing environments before
deployed to Production
= repeatability, reliability and
a strong team process for changes
Pre-2000:deployments using
hand-crafted scripts
Deployment
Script
Development Production
It’s like a master craft to do it well
But…
 Human error is likely
 Time-consuming
 Changes will be missed
2000: deployments using diff tools
Deploy
Development Production
Letting software take the strain
 Much reduced potential for human error
 Generate diff report
 Deployment scripts dynamically generated
Teams keep changes in sync using SQL Compare
Deploy
Production
Deployment
Team Development
Development
But source control is the
recognised development
collaboration tool…
2010: SQL Source Control is released
Production
Development
Deploy
Source
Control
Development Deployment
• Team collaboration
• Prevent painful merges
• Maintain an audit trail of changes
• Undo and roll back
Source Control provides:
VERSION
CONTROL
CONTINUOUS
INTEGRATION:
FUNDAMENTALS
CONTINUOUS
INTEGRATION:
ADVANCED
AUTOMATED
DEPLOYMENT
Four stages to evolve your deployment pipeline
VERSION
CONTROL
Foundation – the first step towards automation
 Greenfield and brownfield projects
 Source for audit trail
 Sandbox for speed and isolation
Four stages to evolve your deployment pipeline
 Automate builds as first step
o Incremental
o Complete
 Verify database changes on check-in can
be built successfullyCONTINUOUS
INTEGRATION:
FUNDAMENTALS
Four stages to evolve your deployment pipeline
 Team discipline
 Customization of build steps
 Automate database tests
CONTINUOUS
INTEGRATION:
ADVANCED
Four stages to evolve your deployment pipeline
 Automation of releases to test and staging
environments
o Every delivery is practice
 Safety
o Rollback strategies and backups
 Approval gate for production-ready releasesAUTOMATED
DEPLOYMENT
Four key stages to evolve your deployment
pipeline
Remember those changes
that were checked in?
Successful build is deployed
to pre-production
Changes to workplace
SOURCE
CONTROL
CONTINUOUS
INTEGRATION:
FUNDAMENTALS
CONTINUOUS
INTEGRATION:
ADVANCED
AUTOMATED
DEPLOYMENT
It’s not always easy
Operations focus is on production protectionprotection
Development pressure is on speed to deliver
…is a DevOps approach the solution?
Focus on the pipeline
Think of the Toyota production system…
 Start with Lean
o Focus on the customer, eliminate waste
o Continuously improve
o Empower the team
o Optimize the whole
o Plan for change
o Automate processes
o Build quality in
What does the future hold?
2015+: Automated deployments as far as Production
Development
Continuous
integration
Build Test
Publish Sync
ALTER
TABLE
foo…
Deployment
script
SQL
Release
Artifact
repository
Production
Release management
Trigger
Deploy
Continuous
Integration
Source
Control
Development Backup Deployment
Remember those changes
that were checked in?
Summary
 Automation is arriving in the database world
o Deployments are already evolving
 Four key stages
o Source control – start here!
o Automate your builds
o Advanced CI – automate tests and integrate frequently
o Continuous delivery – release to pre-production
Documentation and resources
 Continuous Delivery by Jez Humble and David Farley (Addison Wesley)
 The Phoenix Project: A Novel About IT, DevOps, and Helping Your Business Win by
Gene Kim, Kevin Behr and George Spafford (IT Revolution Press)
 The Goal: A Process of Ongoing Improvement by Eliyahu M. Goldratt and Jeff Cox
(Gower Publishing Ltd.)
 Agile Organization by the agile admin (theagileadmin.com)
Further resources:
 Database Delivery Learning program: www.red-gate.com/delivery
o Patterns and practices on Simple-Talk
o Tutorials in Red Gate training academy
 www.youtube.com/user/RedGateVideos - for recorded seminars
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”
Tableatny Wikimedia
Commons
Athlete at Starting block.jpg – Wikimedia Commons. This file is licensed under the Creative Commons Attribution 2.0 Generic
license. Source on Wikimedia Commons: “BXP135671”
Original uploader was Liface at en.wikipedia Wikimedia
Commons
Cross Country US.jpg – Wikimedia Commons. This file is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported
license. Source on Wikimedia Commons: “Transferred from en.wikipedia; transfer was stated to be made by User:TFCforever.”
Notes on license: Liface at the English language Wikipedia, the copyright holder of this work, hereby publishes it under the following
license:GNU head Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free
Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no
Front-Cover Texts, and no Back-Cover Texts. Subject to disclaimers.
Department for Business, Innovation and Skills Flickr Toyota’s new Auris – Flickr. This file is licensed under the Creative Commons Attribution-NoDerivs 2.0 Generic license.
Qrodo Photos Flickr Sport Action – Fencing – Flickr. This file is licensed under the Creative Commons Attribution 2.0 Generic license.
William Warby Flickr Gears – Flickr. This file is licensed under the Creative Commons Attribution 2.0 Generic license.
Guillaume Baviere Flickr 2012-12-30 Paris. Sur les Champs-Elysées.- Flickr. This file is licensed under the Creative Commons Attribution 2.0 Generic license.
William Warby Flickr Jim’s Wood Turning - Flickr. This file is licensed under the Creative Commons Attribution 2.0 Generic license.
Katy Warner Flickr post-its! (01-08-08) – Flickr. This file is licensed under the Creative Commons Attribution-ShareAlike 2.0 Generic (CC BY-SA 2.0)
license.
Possumgirl2 Flickr Ploughing for Maize Crop – Flickr. This file is licensed under the Creative Commons Attribution-ShareAlike 2.0 Generic (CC BY-SA 2.0)
license.
Tom Page Flickr 208/365: Long-jump v2 – Flickr. This file is licensed under the Creative Commons Attribution-ShareAlike 2.0 Generic (CC BY-SA 2.0)
license.
Martin Pettitt Flickr Microlight taking off – Flickr. This file is licensed under the Creative Commons Attribution 2.0 Generic license.
Gunnar Hildonen Flickr Northern lights – Tromso – Flickr. This file is licensed under the Creative Commons Attribution-ShareAlike 2.0 Generic (CC BY-SA 2.0)

The Secret to Pain Free Database Deployments SQLBits 2014

  • 1.
    The secret topain-free database deployments? Automation (yes, really) David Atkinson Product Strategy Red Gate David.Atkinson@red-gate.com @dtabase Continuous delivery for databases Grant Fritchey Product Evangelist Red Gate grant@scarydba.com @GFritchey
  • 2.
    Goals  Evolution ofdatabase deployments  How automation has solved release problems  Evolve your own pipeline
  • 3.
    Database Delivery It’s aboutautomating to Production. In fact – there’s a difference between three continuous approaches: Development Source control CI server Test Production Continuous integration Continuous deployment Continuous delivery Release pipeline
  • 4.
    Databases as abottleneck – historically Odd languages  SQL  Cubes  X-Query 3 reasons why databases have traditionally slowed down deployments: Data persistence  Data outlives applications  Data can’t be replaced DBA paranoia  Frankly… 1 2 3
  • 5.
  • 6.
  • 7.
    Getting your database underversion control is easier
  • 8.
    Lean and agileare more frequently used in software delivery
  • 9.
    We’re learning fromthe ALM space on pipeline building
  • 10.
    The goals ofcontinuous delivery for databases  Faster feedback on changes made o Continuously integrate team changes o Automated testing o Releases rehearsed in testing environments before deployed to Production = repeatability, reliability and a strong team process for changes
  • 11.
  • 12.
    It’s like amaster craft to do it well But…  Human error is likely  Time-consuming  Changes will be missed
  • 13.
    2000: deployments usingdiff tools Deploy Development Production
  • 14.
    Letting software takethe strain  Much reduced potential for human error  Generate diff report  Deployment scripts dynamically generated
  • 15.
    Teams keep changesin sync using SQL Compare Deploy Production Deployment Team Development Development
  • 16.
    But source controlis the recognised development collaboration tool…
  • 17.
    2010: SQL SourceControl is released Production Development Deploy Source Control Development Deployment
  • 18.
    • Team collaboration •Prevent painful merges • Maintain an audit trail of changes • Undo and roll back Source Control provides:
  • 19.
  • 20.
    VERSION CONTROL Foundation – thefirst step towards automation  Greenfield and brownfield projects  Source for audit trail  Sandbox for speed and isolation Four stages to evolve your deployment pipeline
  • 21.
     Automate buildsas first step o Incremental o Complete  Verify database changes on check-in can be built successfullyCONTINUOUS INTEGRATION: FUNDAMENTALS Four stages to evolve your deployment pipeline
  • 22.
     Team discipline Customization of build steps  Automate database tests CONTINUOUS INTEGRATION: ADVANCED Four stages to evolve your deployment pipeline
  • 23.
     Automation ofreleases to test and staging environments o Every delivery is practice  Safety o Rollback strategies and backups  Approval gate for production-ready releasesAUTOMATED DEPLOYMENT Four key stages to evolve your deployment pipeline
  • 24.
  • 25.
    Successful build isdeployed to pre-production
  • 26.
  • 27.
  • 28.
    Operations focus ison production protectionprotection Development pressure is on speed to deliver …is a DevOps approach the solution?
  • 29.
    Focus on thepipeline Think of the Toyota production system…  Start with Lean o Focus on the customer, eliminate waste o Continuously improve o Empower the team o Optimize the whole o Plan for change o Automate processes o Build quality in
  • 30.
    What does thefuture hold?
  • 31.
    2015+: Automated deploymentsas far as Production Development Continuous integration Build Test Publish Sync ALTER TABLE foo… Deployment script SQL Release Artifact repository Production Release management Trigger Deploy Continuous Integration Source Control Development Backup Deployment
  • 32.
  • 33.
    Summary  Automation isarriving in the database world o Deployments are already evolving  Four key stages o Source control – start here! o Automate your builds o Advanced CI – automate tests and integrate frequently o Continuous delivery – release to pre-production
  • 34.
    Documentation and resources Continuous Delivery by Jez Humble and David Farley (Addison Wesley)  The Phoenix Project: A Novel About IT, DevOps, and Helping Your Business Win by Gene Kim, Kevin Behr and George Spafford (IT Revolution Press)  The Goal: A Process of Ongoing Improvement by Eliyahu M. Goldratt and Jeff Cox (Gower Publishing Ltd.)  Agile Organization by the agile admin (theagileadmin.com) Further resources:  Database Delivery Learning program: www.red-gate.com/delivery o Patterns and practices on Simple-Talk o Tutorials in Red Gate training academy  www.youtube.com/user/RedGateVideos - for recorded seminars
  • 35.
    Image sources Author SourceInformation 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” Tableatny Wikimedia Commons Athlete at Starting block.jpg – Wikimedia Commons. This file is licensed under the Creative Commons Attribution 2.0 Generic license. Source on Wikimedia Commons: “BXP135671” Original uploader was Liface at en.wikipedia Wikimedia Commons Cross Country US.jpg – Wikimedia Commons. This file is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported license. Source on Wikimedia Commons: “Transferred from en.wikipedia; transfer was stated to be made by User:TFCforever.” Notes on license: Liface at the English language Wikipedia, the copyright holder of this work, hereby publishes it under the following license:GNU head Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. Subject to disclaimers. Department for Business, Innovation and Skills Flickr Toyota’s new Auris – Flickr. This file is licensed under the Creative Commons Attribution-NoDerivs 2.0 Generic license. Qrodo Photos Flickr Sport Action – Fencing – Flickr. This file is licensed under the Creative Commons Attribution 2.0 Generic license. William Warby Flickr Gears – Flickr. This file is licensed under the Creative Commons Attribution 2.0 Generic license. Guillaume Baviere Flickr 2012-12-30 Paris. Sur les Champs-Elysées.- Flickr. This file is licensed under the Creative Commons Attribution 2.0 Generic license. William Warby Flickr Jim’s Wood Turning - Flickr. This file is licensed under the Creative Commons Attribution 2.0 Generic license. Katy Warner Flickr post-its! (01-08-08) – Flickr. This file is licensed under the Creative Commons Attribution-ShareAlike 2.0 Generic (CC BY-SA 2.0) license. Possumgirl2 Flickr Ploughing for Maize Crop – Flickr. This file is licensed under the Creative Commons Attribution-ShareAlike 2.0 Generic (CC BY-SA 2.0) license. Tom Page Flickr 208/365: Long-jump v2 – Flickr. This file is licensed under the Creative Commons Attribution-ShareAlike 2.0 Generic (CC BY-SA 2.0) license. Martin Pettitt Flickr Microlight taking off – Flickr. This file is licensed under the Creative Commons Attribution 2.0 Generic license. Gunnar Hildonen Flickr Northern lights – Tromso – Flickr. This file is licensed under the Creative Commons Attribution-ShareAlike 2.0 Generic (CC BY-SA 2.0)