Upload
red-gate-software
View
255
Download
0
Tags:
Embed Size (px)
DESCRIPTION
Presentation from Grant Fritchey on how to automate database deployments. Presentation from SQL In The City Workshop
Citation preview
Automate Your Database DeploymentsContinuous delivery for databases
Grant FritcheyRed Gate Software
Development
Continuous integration
Build Test
Publish Sync
ALTERTABLEfoo…
Deployment script
Release management
Artifact repository
Production
Trigger
Review, Backup & deploy
Source control
QA / Test / Pre-production
Continuous delivery for databases
Database release pipeline
Continuous IntegrationDevelopment ProductionTesting
OperationsDatabase development
and change management
Development
Continuous integration
Build Test
Publish Sync
ALTERTABLEfoo…
Deployment script
Release management
Artifact repository
Production
Trigger
Review, Backup & deploy
Source control
QA / Test / Pre-production
Continuous delivery for databases
In this presentation
Database release pipelineContinuous IntegrationDevelopment ProductionTesting
Goals
• Understand the patterns and practices for
automating database deployments.
• Learn about the advantages continuous integration
brings to a release pipeline.
• Understand the challenges databases present for
continuous delivery.
Continuous delivery – what it is and isn’t
Common misconception:
Continuous delivery = Continuous deployment
But in fact:Continuous delivery means making sure your database changes are always production-ready.
Recap: Continuous Delivery
Development Test Production
Continuous integration
Continuous deployment
Continuous delivery
Release pipeline
Approvalgate
Four key stages of the deployment pipeline
SOURCECONTROL
CONTINUOUS INTEGRATION
AUTOMATED TESTING
AUTOMATED DEPLOYMENT
Get your database under control
• Use version control for all code (including tests)
• Commit early, commit often• Use tools
o If it’s hard, people don’t do it• Train people• Build often
SOURCECONTROL
Continuous Integration
• Requires• Code repository• Build automation
• Delivers• Functional testing• Delivery testing• Artifact generation
CONTINUOUS INTEGRATION:
FUNDAMENTALS
Database Deployments in CI
• Complete deployment• Fast• Partial build validation• Functional validation• No artifact
• Incremental deployment• Longer• Harder• Complete build validation• Generates artifact
CONTINUOUS INTEGRATION:
FUNDAMENTALS
Demo
Development
Continuous integration
Build Test
Publish Sync
ALTERTABLEfoo…
Deployment script
Release management
Artifact repository
Production
Trigger
Review, Backup & deploy
Source control
QA / Test / Pre-production
Continuous delivery for databases
Focus here
Build out your release strategyContinuous IntegrationDevelopment ProductionTesting
Automation
Automation
Deploymentpackage
deployment package1
2
3Back to
Development
FAIL
Development
Continuous integration
Build Test
Publish Sync
ALTERTABLEfoo…
Deployment script
Release management
Artifact repository
Production
Trigger
Review, Backup & deploy
Source control
QA / Test / Pre-production
Continuous delivery for databases
Repository might be separate piece of software or part of release management software
Continuous IntegrationDevelopment ProductionTesting
OperationsDatabase development
and change management
Demo
Pre-production is a dry-run
• Staging matches production• As close as possible• Can use diff tool • Or backup and restore AUTOMATED
DEPLOYMENT
Development
Continuous integration
Build Test
Publish Sync
ALTERTABLEfoo…
Deployment script
Release management
Artifact repository
Production
Trigger
Review, Backup & deploy
Source control
QA / Test / Pre-production
Continuous delivery for databases
Continuous IntegrationDevelopment ProductionTesting
OperationsDatabase development
and change management
Wait…
Check for database drift
• Last-minute hotfix• Manual emergency fixes• Unknown changes
AUTOMATED DEPLOYMENT
Ready to go now?…
Plan for things to go wrong
…you need a rollback and recovery strategy
AUTOMATED DEPLOYMENT
Protection
• Backups• Snapshots• Rollback scripts• A/B or blue/green deployments• Roll forward scripts
AUTOMATED DEPLOYMENT
Demo
Recap: Continuous Delivery
Development Test Production
Continuous integration
Continuous deployment
Continuous delivery
Release pipeline
Approvalgate
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
• Patterns and practices on Simple-Talk• Tutorials in Red Gate training academy
• www.youtube.com/user/RedGateVideos - for recorded seminars
Want to try the tools you’ve just seen? Come to our Hands-on Labs
Image sourcesAuthor Source Information
William Warby Flickr Glass Man - Flickr. This file is licensed under the Creative Commons Attribution 2.0 Generic license.
Perry McKenna Flickr Headless Horse – 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.
Ross Harmes Flickr Gear for lightweight snow camping – Flickr. This file is licensed under the Creative Commons Attribution 2.0 Generic license.
Val Gardena – Gröden Marketing
FlickrFis Ski World Cup Val Gardena Gröden – Flickr. This file is licensed under the Creative Commons Attribution 2.0 Generic license
Paul Pehrson Flickr Ice cream sundae - Flickr. This file is licensed under the Creative Commons Attribution 2.0 Generic license