[devops live! meetup] dbmaestro - integrating database changes into devops
TRANSCRIPT
Copyright 2015. Confidential – Distribution prohibited without permission
–
Copyright 2015. Confidential – Distribution prohibited without permission
▪
−Can’t scale, can’t match CD frequency
−Not repeatable, prone to error
Copyright 2015. Confidential – Distribution prohibited without permission
▪
▪
▪
▪
▪
▪
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
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
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
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
▪
▪’
▪
Copyright 2015. Confidential – Distribution prohibited without permission
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
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
Copyright 2015. Confidential – Distribution prohibited without permission
▪
▪−Out of process changes
−Parallel development/branching & merging
−Conflicts
Copyright 2015. Confidential – Distribution prohibited without permission
Safe to automate?Sure…
Copyright 2015. Confidential – Distribution prohibited without permission
Safe to automate?No. Requires manual inspection…
Copyright 2015. Confidential – Distribution prohibited without permission
▪
▪
Simple, right?
NO! We could BREAK production without even knowing…
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
… …
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
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
Copyright 2015. Confidential – Distribution prohibited without permission
▪−Force check in & out for changes
− Labels, etc.
▪
▪
▪
▪
▪
▪
Copyright 2015. Confidential – Distribution prohibited without permission
Database IDE
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
▪ –
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)
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
Copyright 2015. Confidential – Distribution prohibited without permission
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
…
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
Copyright 2015. Confidential – Distribution prohibited without permission
Define a process
Automate the process
Prevent/Alert out of process changes
Copyright 2015. Confidential – Distribution prohibited without permission
Select Task with Check-In Select Tasks for Deployment
Copyright 2015. Confidential – Distribution prohibited without permission
ScriptsCompare & Sync Tools
TeamWork
Database Change Process √
Version Control √ √
No “Out of Process” Changes √
Automate Your Deployment √ (√) √
Copyright 2015. Confidential – Distribution prohibited without permission
Copyright 2015. Confidential – Distribution prohibited without permission
Q & ACindy Bean
[email protected]@dbmaestro.com