59
© 2013 IBM Corporation A Continuous Delivery Safety Net for Databases

A Continuous Delivery Safety Net for Databases

Embed Size (px)

Citation preview

Page 1: A Continuous Delivery Safety Net for Databases

© 2013 IBM Corporation

A Continuous Delivery Safety Net for Databases

Page 2: A Continuous Delivery Safety Net for Databases

2 © 2015 IBM Corporation

Speaking Today

• Eric is a DevOps Evangelist with IBM where he helps customers get the most out of their build, deploy and release processes.

• Today he works with customers and industry leaders to find the best ways of adopting continuous delivery and DevOps.

• Eric is the author of Application Deploy and Release for Dummies.

• @EricMinick

Eric Minick

• Yaniv is the Co-Founder and CTO of DBmaestro, the leading provider of DevOps for Database solutions which enable control of database development and deployment.

• Yaniv has spent the last years raising awareness about the challenges around database development and deployment, and how to support database Continuous Delivery.

• @DBmaestro

Yaniv

Yehuda

Page 3: A Continuous Delivery Safety Net for Databases

3 © 2015 IBM Corporation

Why Waterfall Fails

Page 4: A Continuous Delivery Safety Net for Databases

4 © 2015 IBM Corporation

Continuous Delivery helps us learn faster

Automated flow from Build to “ready for prod”

Push button release to production

Lots of feedback Emphasis on always

shippable

Themes

Page 5: A Continuous Delivery Safety Net for Databases

5 © 2015 IBM Corporation

“Classic” CD

build dev

test

system

test UAT sign-off staging prod

Page 6: A Continuous Delivery Safety Net for Databases

6 © 2015 IBM Corporation

The Build Pipeline

build dev

test

system

test UAT sign-off staging prod

for (env in testEnvironments) {

deploy( build, env );

runTests (env.testType, env);

}

Page 7: A Continuous Delivery Safety Net for Databases

7 © 2015 IBM Corporation

Composite apps: many tiers & components

Page 8: A Continuous Delivery Safety Net for Databases

8 © 2015 IBM Corporation

Composite apps: many tiers & components

An Application might have

dozens of components

Page 9: A Continuous Delivery Safety Net for Databases

9 © 2015 IBM Corporation

Composite apps: many tiers & components

An Application might have

dozens of components

Delivered by Different Teams

Page 10: A Continuous Delivery Safety Net for Databases

10 © 2015 IBM Corporation

Composite apps: many tiers & components

Which build does “Login” test?

Page 11: A Continuous Delivery Safety Net for Databases

11 © 2015 IBM Corporation

Build pipelines in composite applications

build dev

test

system

test UAT sign-off staging prod

build dev

test

system

test UAT sign-off staging prod

build dev

test

system

test UAT sign-off staging prod

build dev

test

system

test UAT sign-off staging prod

build dev

test

system

test UAT sign-off staging prod

build dev

test

system

test UAT sign-off staging prod

build dev

test

system

test UAT sign-off staging prod

build dev

test

system

test UAT sign-off staging prod

build dev

test

system

test UAT sign-off staging prod

build dev

test

system

test UAT sign-off staging prod

build dev

test

system

test UAT sign-off staging prod

build dev

test

system

test UAT sign-off staging prod

Page 12: A Continuous Delivery Safety Net for Databases

12 © 2015 IBM Corporation

Combine Versioned Stuff into Versioned App

• Manage a set of tested component versions as a single unit

• Guarantee the validated versions of related components are

deployed together

• Ease of promoting applications between environments

1

1

2

3

UAT Stage PROD

Promote Promote

Web

Mid. Code

Mid. Config

DB

Snapshot

Page 13: A Continuous Delivery Safety Net for Databases

13 © 2015 IBM Corporation

Expanding “All the Stuff”

Systems of Record

– z/OS

– iSeries

Mobile

– iOS / Android

– Mobile Testing

Infrastructure

– Treating environment as part of Application

Page 14: A Continuous Delivery Safety Net for Databases

14 © 2015 IBM Corporation

Combine Versioned Stuff into Versioned App

• Manage a set of tested component versions as a single unit

• Guarantee the validated versions of related components are

deployed together

• Ease of promoting applications between environments

1

1

2

3

UAT Stage PROD

Promote Promote

Web

Mid. Code

Mid. Config

DB

Snapshot

Page 15: A Continuous Delivery Safety Net for Databases

15 © 2015 IBM Corporation

• Old adage but true

• The database is often neglected and therefore can become the weakest link

• Manual processes

• Database/Code Silos exist…

• Don’t always communicate effectively

• Need to follow same procedures & best practices

• Essential from a compliance and business point of view

• Should be the strongest link

The Weakest Link In a Chain ???

Page 16: A Continuous Delivery Safety Net for Databases

16 © 2015 IBM Corporation

Recently Conducted DBmaestro Survey – Over 150 Companies

– Over 200 participants

Why is that happening?

Continuous Delivery Moving Ahead!

Page 17: A Continuous Delivery Safety Net for Databases

17 © 2015 IBM Corporation

Why Continuous Delivery?

Page 18: A Continuous Delivery Safety Net for Databases

18 © 2015 IBM Corporation

Why?

What about the database?

Page 19: A Continuous Delivery Safety Net for Databases

19 © 2015 IBM Corporation

Mistrust…

So why not move forward?

Page 20: A Continuous Delivery Safety Net for Databases

20 © 2015 IBM Corporation

Mistrust…

Page 21: A Continuous Delivery Safety Net for Databases

21 © 2015 IBM Corporation

What is the problem?

Root Causes for issues: – Challenging manual version control process

– Static deployments code overrides

– Dynamic deployments unaware of version control

– No release automation red-flags – don’t know when to stop the line…

Page 22: A Continuous Delivery Safety Net for Databases

22 © 2015 IBM Corporation

Mistrust in version control…

Version Control Process

(file based)

Development Process

Check-Out Script

Modify Script

Get updated Script from

DB

Check-In Script

Compile Script in DB

Debug Script in DB

Page 23: A Continuous Delivery Safety Net for Databases

23 © 2015 IBM Corporation

Version Control Process

(file based)

Development Process

Check-Out Script

Modify Script

Get updated Script from

DB

Check-In Script

Compile Script in DB

Debug Script in DB

A

A’

Mistrust in version control…

Page 24: A Continuous Delivery Safety Net for Databases

24 © 2015 IBM Corporation

Version Control Process

(file based)

Development Process

Check-Out Script

Modify Script

Get updated Script from

DB

Check-In Script

Compile Script in DB

Debug Script in DB

?

? ?

?

A

A’

Mistrust in version control…

No single source of truth…

Page 25: A Continuous Delivery Safety Net for Databases

25 © 2015 IBM Corporation

Scripts & Version Control

Challenges…

– Code-overrides

– Working on the wrong revisions

– Scripts do not always find their way to the version control solution

– Out of process updates go unnoticed

– Hard to locate outdated update scripts

Playing safe? what we really need:

– The actual code of the object

– The upgrade script

– A roll-back script

Scripts

– Hard to test in their entirely (holistically)

– Hard to test due to colliding dependencies

– Need to run in a specific order…

– Much harder to deal with project scope changes

Page 26: A Continuous Delivery Safety Net for Databases

26 © 2015 IBM Corporation

1.1 1.1.1 1.1 1.2 1.3 1.4 1.5 1.6 1.7

Mistrust in static scripting automation…

Int QA Stage Prod

Database Deploy Script

Environment

Re-Base (due to

defects)

Dev

Dev

Dev

Model

1.1 1.2

1.2 1.3

1.3 1.4

1.1 1.1 1.4 1.7 ? 1.1.1

Page 27: A Continuous Delivery Safety Net for Databases

27 © 2015 IBM Corporation

1.1 1.1.1 1.1 1.2 1.3 1.4 1.5 1.6 1.7

Int QA Stage Prod

Database Deploy Script

Environment

Re-Base (due to

defects)

Dev

Dev

Dev

Model

1.1 1.2

1.2 1.3

1.3 1.4

1.1 1.1 1.4 1.7

1.1 1.2

1.2 1.3

1.3 1.4

? 1.1.1

Mistrust in static scripting automation…

Page 28: A Continuous Delivery Safety Net for Databases

28 © 2015 IBM Corporation

1.1 1.1.1 1.1 1.2 1.3 1.4 1.5 1.6 1.7

Int QA Stage Prod

Database Deploy Script

Environment

Re-Base (due to

defects)

Dev

Dev

Dev

Model

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.1 1.4 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

? 1.1.1

Mistrust in static scripting automation…

Page 29: A Continuous Delivery Safety Net for Databases

29 © 2015 IBM Corporation

1.1 1.1.1 1.1 1.2 1.3 1.4 1.5 1.6 1.7

Int QA Stage Prod

Database Deploy Script

Environment

Re-Base (due to

defects)

Dev

Dev

Dev

Model

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.1 1.4 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

? 1.1.1

Mistrust in static scripting automation…

Page 30: A Continuous Delivery Safety Net for Databases

30 © 2015 IBM Corporation

X 1.1 1.1.1 1.1 1.2 1.3 1.4 1.5 1.6 1.7

Int QA Stage Prod

Database Deploy Script

Environment

Re-Base (due to

defects)

Dev

Dev

Dev

Model

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.1 1.4 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

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

Mistrust in static scripting automation…

Page 31: A Continuous Delivery Safety Net for Databases

31 © 2015 IBM Corporation

Scripts are static…

Scripts, unless super sophisticated:

– Unaware of changes made in the target environment

– Time passed from their coding to the time they are run

– Potentially overriding production hot-fixes or work done in parallel by another team

Content changes are very hard to manage

– Metadata & lookup content does not practically fit into the VC

– In most cases they are simply not managed

Page 32: A Continuous Delivery Safety Net for Databases

32 © 2015 IBM Corporation

Gaining Trust!

Coordinated Process Traceability

Start in the Beginning

No Out-of-Process Changes

Impact Analysis

Automation

Task Based Development

Well Defined Processes

Page 33: A Continuous Delivery Safety Net for Databases

33 © 2015 IBM Corporation

Version Control - One Enforced Process

Page 34: A Continuous Delivery Safety Net for Databases

34 © 2015 IBM Corporation

Dealing with challenges…

Integrated Database Version Control process – Leverage proven version control best practices

• Forcing check in & out for changes

• Labels

• etc..

– No code-overrides

– Always working with the correct revision

– All changes are documented

– Always know who did what, when, why and from where

– No out-of-process changes

– Supporting structure, code and content

No time spent on manual coding of the change scripts

Page 35: A Continuous Delivery Safety Net for Databases

35 © 2015 IBM Corporation

Bonus points – dealing with scope changes

Task based development… – Correlate each database change with a change request

• Task ID

• Work Item

• Trouble Ticket

• CR

• etc…

…enables task based deployments – Partial deployments (a feature, a collection of bugs, etc…)

– Scope changes easily synced between code and database

Page 36: A Continuous Delivery Safety Net for Databases

36 © 2015 IBM Corporation

For deployment automation we need:

Repeatability & Safety

Using tools make sense …

Page 37: A Continuous Delivery Safety Net for Databases

37 © 2015 IBM Corporation

Build & Deploy On Demand

1.1 1.2 1.3 1.4 1.5 1.6 1.7

Int QA Stage Prod

Database Deploy Script

Environment

Re-Base (due to

defects)

Dev

Dev

Dev

Model

1.1 1.2

1.2 1.3

1.3 1.4

1.1 1.4

1.1 1.1 1.1 1.4 1.7 1.1.1 1.7 1.1.1 1.7

Page 38: A Continuous Delivery Safety Net for Databases

38 © 2015 IBM Corporation

Build & Deploy On Demand

1.1 1.2 1.3 1.4 1.5 1.6 1.7

Int QA Stage Prod

Database Deploy Script

Environment

Re-Base (due to

defects)

Dev

Dev

Dev

Model

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.4

1.4 1.7

1.1 1.1 1.1 1.4 1.7 1.1.1 1.7 1.1.1 1.7

Page 39: A Continuous Delivery Safety Net for Databases

39 © 2015 IBM Corporation

Build & Deploy On Demand

1.1 1.2 1.3 1.4 1.5 1.6 1.7

Int QA Stage Prod

Database Deploy Script

Environment

Re-Base (due to

defects)

Dev

Dev

Dev

Model

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.4

1.4 1.7

1.1 1.1 1.1 1.4 1.7

Out of

Process

Change

1.1.1 1.7 1.1.1 1.7

Page 40: A Continuous Delivery Safety Net for Databases

40 © 2015 IBM Corporation

Build & Deploy On Demand

1.1 1.2 1.3 1.4 1.5 1.6 1.7

Int QA Stage Prod

Database Deploy Script

Environment

Re-Base (due to

defects)

Dev

Dev

Dev

Model

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.4

1.4 1.7

1.1.1 1.7

1.1 1.1 1.1 1.4 1.7

File Based

Version

Control

Out of

Process

Change

1.1.1 1.7 1.1.1 1.7

Page 41: A Continuous Delivery Safety Net for Databases

41 © 2015 IBM Corporation

Build & Deploy On Demand

1.1 1.2 1.3 1.4 1.5 1.6 1.7

*

Int QA Stage Prod

Database Deploy Script

Environment

Re-Base (due to

defects)

Dev

Dev

Dev

Model

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.4

1.4 1.7

1.1.1 1.7

1.1 1.1 1.1 1.4 1.7

File Based

Version

Control

Out of

Process

Change

1.1.1 1.7 1.1.1 1.7

Page 42: A Continuous Delivery Safety Net for Databases

42 © 2015 IBM Corporation

Using tools

Test cases using compare & sync tools:

An index exists in source (QA) but not in target (Production)

What should we do? Add the index or not?

Page 43: A Continuous Delivery Safety Net for Databases

43 © 2015 IBM Corporation

Compare & Sync tools

Safe to automate?

Sure… (?)

Page 44: A Continuous Delivery Safety Net for Databases

44 © 2015 IBM Corporation

Compare & Sync tools

Safe to automate?

No. Requires manual inspection…

Page 45: A Continuous Delivery Safety Net for Databases

45 © 2015 IBM Corporation

Safe?

Simple, right? NO! we are going to BREAK production without even

knowing…

Page 46: A Continuous Delivery Safety Net for Databases

46 © 2015 IBM Corporation

Why break production???

A compare & sync tool: 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

Mistrust AGAIN…

So…no automation… as we fear automating problems into production and a major risk!!!

Page 47: A Continuous Delivery Safety Net for Databases

47 © 2015 IBM Corporation

We need to leverage version control into deployment decisions…

Page 48: A Continuous Delivery Safety Net for Databases

48 © 2015 IBM Corporation

Safety Net For Deployment Automation

Static script based deployment

Page 49: A Continuous Delivery Safety Net for Databases

49 © 2015 IBM Corporation

Deploying Changes if Needed

Development Baseline

Previous Label /

Production Golden Copy

Production

If we had the index in the baseline =>

we should take it down from production…

(Deploy Change)

Page 50: A Continuous Delivery Safety Net for Databases

50 © 2015 IBM Corporation

Or Protecting Target Environment…

Development Baseline

Previous Label /

Production Golden Copy

Production

BUT… If no index in baseline =>

we should protect the NEW index on production!!!

(Protect Target)

Page 51: A Continuous Delivery Safety Net for Databases

51 © 2015 IBM Corporation

Deployment Automation

And Merge!!!

Page 52: A Continuous Delivery Safety Net for Databases

52 © 2015 IBM Corporation

Conflict Resolving – Database Code

Page 53: A Continuous Delivery Safety Net for Databases

53 © 2015 IBM Corporation

Impact Analysis – Code & Content

Page 54: A Continuous Delivery Safety Net for Databases

54 © 2015 IBM Corporation

Impact Analysis! not Damage Control…

Page 55: A Continuous Delivery Safety Net for Databases

55 © 2015 IBM Corporation

Safety Net For Deployment Automation

Database Safe Deployment Automation: Leverages version control (baselines & previous revisions)

Has a flexible scope (deploy multi schema to single task or work item)

Can be run as a batch process (repeatable & consistent)

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

Deals with conflicts & merges to match code agility

Can raise red flags to stop the line…

if requires human intervention

Page 56: A Continuous Delivery Safety Net for Databases

56 © 2015 IBM Corporation

What is DBmaestro TeamWork?

Database Enforced Change Management solution + Database version control + Enforce best practices + Plugs into the ALM (change request, tickets & work items)

+ Database merge & change impact analysis + Know who can do what, where, when & why

DevOps Solution for databases + Baseline aware deployment automation, rollback &

recovery + Reduce database deployment issues + Plugs into release management & Continuous Delivery

Page 57: A Continuous Delivery Safety Net for Databases

57 © 2015 IBM Corporation

IBM UrbanCode Deploy Visibility and automated control of your application deployment process

Mobile App

Team

Middleware

team Backend Systems of

Record

• Manage application

components and versions

• Manage configurations across

all environments

• Offer secure ‘self-service’ capabilities

• Increase transparency

• Ensure governance and

compliancy

Page 58: A Continuous Delivery Safety Net for Databases

58 © 2015 IBM Corporation

www.ibm.com/devops

Page 59: A Continuous Delivery Safety Net for Databases

59 © 2015 IBM Corporation

© Copyright IBM Corporation 2014. All rights reserved. The information contained in these materials is provided for informational purposes only, and is provided AS IS without warranty of any kind, express or implied. IBM shall not be responsible for any damages arising out of the use of, or otherwise related to, these materials. Nothing contained in these materials is intended to, nor shall have the effect of, creating any warranties or representations from IBM or its suppliers or licensors, or altering the terms and conditions of the applicable license agreement governing the use of IBM software. References in these materials to IBM products, programs, or services do not imply that they will be available in all countries in which IBM operates. Product release dates and/or capabilities referenced in these materials may change at any time at IBM’s sole discretion based on market opportunities or other factors, and are not intended to be a commitment to future product or feature availability in any way. IBM, the IBM logo, Rational, the Rational logo, and other IBM products and services are trademarks of the International Business Machines Corporation, in the United States, other countries or both. Other company, product, or service names may be trademarks or service marks of others.

www.ibm.com/devops