the secret to pain free database deployments sqlbits 2014

35
The secret to pain-free database deployments? Automation (yes, really) David Atkinson Product Strategy Red Gate [email protected] @dtabase Continuous delivery for databases Grant Fritchey Product Evangelist Red Gate [email protected] @GFritchey

Upload: red-gate-software

Post on 20-Aug-2015

187 views

Category:

Software


0 download

TRANSCRIPT

Page 1: The Secret to Pain Free Database Deployments SQLBits 2014

The secret to pain-free database deployments? Automation (yes, really)

David AtkinsonProduct Strategy

Red Gate

[email protected] @dtabase

Continuous delivery for databases

Grant FritcheyProduct Evangelist

Red Gate

[email protected]@GFritchey

Page 2: The Secret to Pain Free Database Deployments SQLBits 2014

Goals

Evolution of database deployments How automation has solved release problems Evolve your own pipeline

Page 3: The Secret to Pain Free Database Deployments SQLBits 2014

Database Delivery

It’s about automating to Production.

In fact – there’s a difference between three continuous approaches:

DevelopmentSource control CI server Test Production

Continuous integration

Continuous deployment

Continuous delivery

Releasepipeline

Page 4: The Secret to Pain Free Database Deployments SQLBits 2014

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

Page 5: The Secret to Pain Free Database Deployments SQLBits 2014

So what’s changed?

Page 6: The Secret to Pain Free Database Deployments SQLBits 2014

Tools, techniques and processes…

Page 7: The Secret to Pain Free Database Deployments SQLBits 2014

Getting your database under version control is easier

Page 8: The Secret to Pain Free Database Deployments SQLBits 2014

Lean and agile are more frequently used in software delivery

Page 9: The Secret to Pain Free Database Deployments SQLBits 2014

We’re learning from the ALM space on pipeline building

Page 10: The Secret to Pain Free Database Deployments SQLBits 2014

The goals of continuous delivery for databases

Faster feedback on changes madeo Continuously integrate team changeso Automated testingo Releases rehearsed in testing environments before

deployed to Production

= repeatability, reliability and a strong team process for changes

Page 11: The Secret to Pain Free Database Deployments SQLBits 2014

Pre-2000:deployments using hand-crafted scripts

DeploymentScript

Development Production

Page 12: The Secret to Pain Free Database Deployments SQLBits 2014

It’s like a master craft to do it well

But…

Human error is likely

Time-consuming

Changes will be missed

Page 13: The Secret to Pain Free Database Deployments SQLBits 2014

2000: deployments using diff tools

Deploy

Development Production

Page 14: The Secret to Pain Free Database Deployments SQLBits 2014

Letting software take the strain

Much reduced potential for human error

Generate diff report

Deployment scripts dynamically generated

Page 15: The Secret to Pain Free Database Deployments SQLBits 2014

Teams keep changes in sync using SQL Compare

Deploy

Production

Deployment

Team Development

Development

Page 16: The Secret to Pain Free Database Deployments SQLBits 2014

But source control is the recognised development collaboration tool…

Page 17: The Secret to Pain Free Database Deployments SQLBits 2014

2010: SQL Source Control is released

Production

Development

Deploy

Source ControlDevelopment Deployment

Page 18: The Secret to Pain Free Database Deployments SQLBits 2014

• Team collaboration

• Prevent painful merges

• Maintain an audit trail of changes

• Undo and roll back

Source Control provides:

Page 19: The Secret to Pain Free Database Deployments SQLBits 2014

VERSIONCONTROL

CONTINUOUS INTEGRATION:

FUNDAMENTALS

CONTINUOUS INTEGRATION:

ADVANCED

AUTOMATED DEPLOYMENT

Four stages to evolve your deployment pipeline

Page 20: The Secret to Pain Free Database Deployments SQLBits 2014

VERSIONCONTROL

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

Page 21: The Secret to Pain Free Database Deployments SQLBits 2014

Automate builds as first stepo Incrementalo Complete

Verify database changes on check-in can be built successfullyCONTINUOUS

INTEGRATION:FUNDAMENTALS

Four stages to evolve your deployment pipeline

Page 22: The Secret to Pain Free Database Deployments SQLBits 2014

Team discipline Customization of build steps Automate database tests

CONTINUOUS INTEGRATION:

ADVANCED

Four stages to evolve your deployment pipeline

Page 23: The Secret to Pain Free Database Deployments SQLBits 2014

Automation of releases to test and staging environmentso Every delivery is practice

Safetyo Rollback strategies and backups

Approval gate for production-ready releasesAUTOMATEDDEPLOYMENT

Four key stages to evolve your deployment pipeline

Page 24: The Secret to Pain Free Database Deployments SQLBits 2014

Remember those changes that were checked in?

Page 25: The Secret to Pain Free Database Deployments SQLBits 2014

Successful build is deployed to pre-production

Page 26: The Secret to Pain Free Database Deployments SQLBits 2014

Changes to workplace

SOURCECONTROL

CONTINUOUS INTEGRATION:

FUNDAMENTALS

CONTINUOUS INTEGRATION:

ADVANCED

AUTOMATED DEPLOYMENT

Technology is only half the story…

Page 28: The Secret to Pain Free Database Deployments SQLBits 2014

Operations focus is on production protectionprotection

Development pressure is on speed to deliver

…is a DevOps approach the solution?

Page 29: The Secret to Pain Free Database Deployments SQLBits 2014

Focus on the pipelineThink of the Toyota production system…

Start with Leano Focus on the customer, eliminate wasteo Continuously improveo Empower the teamo Optimize the wholeo Plan for changeo Automate processeso Build quality in

Page 30: The Secret to Pain Free Database Deployments SQLBits 2014

What does the future hold?

Page 31: The Secret to Pain Free Database Deployments SQLBits 2014

2015+: Automated deployments as far as Production

Development

Continuous integration

Build Test

Publish Sync

ALTERTABLEfoo…

Deployment script

SQLRelease

Artifact repository

Production

Release management

Trigger

Deploy

Continuous IntegrationSource ControlDevelopment Backup Deployment

Page 32: The Secret to Pain Free Database Deployments SQLBits 2014

Remember those changes that were checked in?

Page 33: The Secret to Pain Free Database Deployments SQLBits 2014

Summary

Automation is arriving in the database worldo Deployments are already evolving

Four key stageso Source control – start here!o Automate your buildso Advanced CI – automate tests and integrate frequentlyo Continuous delivery – release to pre-production

Page 34: The Secret to Pain Free Database Deployments SQLBits 2014

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-Talko Tutorials in Red Gate training academy

www.youtube.com/user/RedGateVideos - for recorded seminars

Page 35: The Secret to Pain Free Database Deployments SQLBits 2014

Image sourcesAuthor 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)