[devops live! meetup] dbmaestro - integrating database changes into devops

30
Copyright 2015. Confidential – Distribution prohibited without permission

Upload: mike-rosado-devops-casm-mcsa-msitp-mcse

Post on 22-Jan-2017

95 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: [DevOps Live! Meetup]  DBMaestro - Integrating Database Changes into DevOps

Copyright 2015. Confidential – Distribution prohibited without permission

Page 2: [DevOps Live! Meetup]  DBMaestro - Integrating Database Changes into DevOps

Copyright 2015. Confidential – Distribution prohibited without permission

−Can’t scale, can’t match CD frequency

−Not repeatable, prone to error

Page 3: [DevOps Live! Meetup]  DBMaestro - Integrating Database Changes into DevOps

Copyright 2015. Confidential – Distribution prohibited without permission

Page 4: [DevOps Live! Meetup]  DBMaestro - Integrating Database Changes into DevOps

Copyright 2015. Confidential – Distribution prohibited without permission

Developer PC• Get Latest• Local Development• Check-In Code

Build Server• Get Latest• Compile• Check-In Binaries

UAT Servers• Copy Binaries• Run Auto Tests

Prod Servers• Copy Binaries

Binaries – Source Control Repository

Source Code Files –Source Control Repository

Test Servers• Copy Binaries• Run Auto Tests

In Case of Defects: Always Return to Dev

Page 5: [DevOps Live! Meetup]  DBMaestro - Integrating Database Changes into DevOps

Copyright 2015. Confidential – Distribution prohibited without permission

− Schema structure

− Code

− Content and meta-content

− Internal dependencies

− …

Developer PC• Get Latest• Local Development• Check-In Code

Build Server• Get Latest• Compile• Check-In Binaries

Source Code Files –Source Control Repository

Page 6: [DevOps Live! Meetup]  DBMaestro - Integrating Database Changes into DevOps

Copyright 2015. Confidential – Distribution prohibited without permission

−Database change process

−Version control

−No “Out of Process” changes

−No unauthorized changes

−Automate your deployments

−Scripts

−Compare & Sync Tools

−Database Enforced Source Control

Page 7: [DevOps Live! Meetup]  DBMaestro - Integrating Database Changes into DevOps

Copyright 2015. Confidential – Distribution prohibited without permission

−One script per object or script per change

−Where to store, filesystem or version control

−How to name files

▪’

Page 8: [DevOps Live! Meetup]  DBMaestro - Integrating Database Changes into DevOps

Copyright 2015. Confidential – Distribution prohibited without permission

Page 9: [DevOps Live! Meetup]  DBMaestro - Integrating Database Changes into DevOps

Copyright 2015. Confidential – Distribution prohibited without permission

▪−Unaware of changes made in the target environment

−Time passed from their creation until their execution

−Potential to override production hot-fixes & work done by parallel teams

−Order of script execution (data dependencies)

▪−Meta data & lookup content does not fit practically into the version

control

−In most cases, they are simply not managed

Page 10: [DevOps Live! Meetup]  DBMaestro - Integrating Database Changes into DevOps

Copyright 2015. Confidential – Distribution prohibited without permission

X1.11.1.11.11.21.31.41.51.61.7

Int QA Pre Prod Prod

Database Deploy Script

Environment

Re-Base (due to defects)

DevDev

DevModel

1.1 1.2

1.2 1.3

1.3 1.4

1.4 1.5

1.5 1.6

1.6 1.7

1.11.11.41.7

1.1 1.2

1.2 1.3

1.3 1.4

1.4 1.5

1.5 1.6

1.6 1.7

1.1 1.2

1.2 1.3

1.3 1.4

1.4 1.5

1.5 1.6

1.6 1.7

Out of Process Change

X

X

X

X

X

? 1.1.1

X

Page 11: [DevOps Live! Meetup]  DBMaestro - Integrating Database Changes into DevOps

Copyright 2015. Confidential – Distribution prohibited without permission

▪−Out of process changes

−Parallel development/branching & merging

−Conflicts

Page 12: [DevOps Live! Meetup]  DBMaestro - Integrating Database Changes into DevOps

Copyright 2015. Confidential – Distribution prohibited without permission

Safe to automate?Sure…

Page 13: [DevOps Live! Meetup]  DBMaestro - Integrating Database Changes into DevOps

Copyright 2015. Confidential – Distribution prohibited without permission

Safe to automate?No. Requires manual inspection…

Page 14: [DevOps Live! Meetup]  DBMaestro - Integrating Database Changes into DevOps

Copyright 2015. Confidential – Distribution prohibited without permission

Simple, right?

NO! We could BREAK production without even knowing…

Page 15: [DevOps Live! Meetup]  DBMaestro - Integrating Database Changes into DevOps

Copyright 2015. Confidential – Distribution prohibited without permission

▪− Is unaware of any changes that occurred before the time it ran

−Has no knowledge of changes that took place at the target environment

−Does not leverage version control for more information

−Unable to deal with conflicts & merges between different teams

−Requires manual inspection

−Requires detailed knowledge regarding each change as part of the process

… …

Page 16: [DevOps Live! Meetup]  DBMaestro - Integrating Database Changes into DevOps

Copyright 2015. Confidential – Distribution prohibited without permission

Build Server• Impact Analysis• Generate Delta Script• Merge Conflicts

UAT Servers• Execute SQL Scripts• Run Auto Tests

Prod Servers• Execute SQL Scripts

Binaries – Source Control Repository

Database Source Control Repository

Test Servers• Execute SQL Scripts• Run Auto Tests

In Case of Defects: Return to Dev or Fix Locally and Handle Conflicts

Development Databases• Enforced Source Control• Check-In Database

Changes

Database Deployment Safety Net

Page 17: [DevOps Live! Meetup]  DBMaestro - Integrating Database Changes into DevOps

Copyright 2015. Confidential – Distribution prohibited without permission

Database integrated version control

Plus into ALM systems

Database change Impact analysis

−Database version control

−Database change process

−Database deployment automation

−Plugs into ALM and release management for continuous delivery

Page 18: [DevOps Live! Meetup]  DBMaestro - Integrating Database Changes into DevOps

Copyright 2015. Confidential – Distribution prohibited without permission

▪−Force check in & out for changes

− Labels, etc.

Page 19: [DevOps Live! Meetup]  DBMaestro - Integrating Database Changes into DevOps

Copyright 2015. Confidential – Distribution prohibited without permission

Database IDE

Page 20: [DevOps Live! Meetup]  DBMaestro - Integrating Database Changes into DevOps

Copyright 2015. Confidential – Distribution prohibited without permission

Source vs. Target

Action

= No Action

≠ ?

Source vs. Baseline

Target vs. Baseline

Action

= = No Action

≠ = Deploy Changes

= ≠ Protect Target

≠ ≠ Merge Changes

You do not have all of the information

Including the Baseline in the impact analysis identifies conflicts to prevent code overrides

Simple Compare & SyncBaseline Aware Analysis

▪ –

Page 21: [DevOps Live! Meetup]  DBMaestro - Integrating Database Changes into DevOps

Copyright 2015. Confidential – Distribution prohibited without permission

Development Baseline

Previous Label /

Production Golden Copy

Production

No index in baseline => we should protect the NEW index on production!!!

(Protect Target)

Page 22: [DevOps Live! Meetup]  DBMaestro - Integrating Database Changes into DevOps

Copyright 2015. Confidential – Distribution prohibited without permission

BUT… If we had the index in the baseline => we should take it down from production…

(Deploy Change)

Development Baseline

Previous Label /

Production Golden Copy

Production

Page 23: [DevOps Live! Meetup]  DBMaestro - Integrating Database Changes into DevOps

Copyright 2015. Confidential – Distribution prohibited without permission

Page 24: [DevOps Live! Meetup]  DBMaestro - Integrating Database Changes into DevOps

Copyright 2015. Confidential – Distribution prohibited without permission

▪−Leverages version control

−Can be run as a batch process

−Integrates to ALM (labels, Continuous Integration & Delivery)

−Deals with conflicts & merges to match code agility

Page 25: [DevOps Live! Meetup]  DBMaestro - Integrating Database Changes into DevOps

Copyright 2015. Confidential – Distribution prohibited without permission

– Releases can be based on schema/database, labels, objects, tasks

– Continuous Delivery Pipeline Builder

– Call DBmaestro commands from any release automation tool

– Plugins for popular tools such as Jenkins, CA Release Automation

– Builds script based on release content

– Eliminates manual editing of scripts when a release changes scope

– Includes object dependencies in correct order

Page 26: [DevOps Live! Meetup]  DBMaestro - Integrating Database Changes into DevOps

Copyright 2015. Confidential – Distribution prohibited without permission

Define a process

Automate the process

Prevent/Alert out of process changes

Page 27: [DevOps Live! Meetup]  DBMaestro - Integrating Database Changes into DevOps

Copyright 2015. Confidential – Distribution prohibited without permission

Select Task with Check-In Select Tasks for Deployment

Page 28: [DevOps Live! Meetup]  DBMaestro - Integrating Database Changes into DevOps

Copyright 2015. Confidential – Distribution prohibited without permission

ScriptsCompare & Sync Tools

TeamWork

Database Change Process √

Version Control √ √

No “Out of Process” Changes √

Automate Your Deployment √ (√) √

Page 29: [DevOps Live! Meetup]  DBMaestro - Integrating Database Changes into DevOps

Copyright 2015. Confidential – Distribution prohibited without permission

Page 30: [DevOps Live! Meetup]  DBMaestro - Integrating Database Changes into DevOps

Copyright 2015. Confidential – Distribution prohibited without permission

Q & ACindy Bean

[email protected]@dbmaestro.com