51
Best Practices for Database Continuous Delivery DBmaestro and Perforce Joint-Webinar October 21 st , 2015

Challenges and best practices of database continuous delivery

Embed Size (px)

Citation preview

Page 1: Challenges and best practices of database continuous delivery

Best Practices for Database Continuous Delivery

DBmaestro and Perforce Joint-Webinar

October 21st, 2015

Page 2: Challenges and best practices of database continuous delivery

▪ You will be on mute for the duration of the event

▪ We are now talking so please type a message in the Questions box in the Control Panel if you can’t hear us (please check your speakers and GoToWebinar audio settings first)

▪ There will be a Q+A session at the end, you can start submitting you questions on the Q&A bar on your gotowebinar dashboard.

▪ A recording of the full webinar will be put up online

Before We Begin

Page 3: Challenges and best practices of database continuous delivery

Presenters

Mark WarrenProduct Marketing Director, Perforce

Mark has over 20 years experience as a user and developer of tools to improve software delivery processes.

Page 4: Challenges and best practices of database continuous delivery

Presenters

Yaniv YehudaCo-Founder & CTO at DBmaestro

Spent the last years raising awareness about the challenges around database development and deployment, and how to support database Continuous Delivery.

Page 5: Challenges and best practices of database continuous delivery

Outline

▪ The Adoption of Continuous Delivery▪ The Reasons why the Database is Often Left Behind▪ Single Source of Truth for your Database▪ Best Practices for Including the Database in CD▪ The Bigger Picture – Automation and Stopping the

Line▪ Q&A

Page 6: Challenges and best practices of database continuous delivery

Industry Perspective

Waterfall• Annual releases • Mostly manual

Agile• Release more

than once a year

• Some automation

Continuous• Weekly/daily

updates• Massive

automation

“The days when a successful organization could release software once every 12 to 18 months are over.”

“Continuous Delivery is Reshaping the Future of ALM”, Kurt Bittner, Forrester, July 2013

Page 7: Challenges and best practices of database continuous delivery

Continuous Delivery Is Moving Ahead!

Recently Conducted DBmaestro Survey• Over 350 participants

Page 8: Challenges and best practices of database continuous delivery

Why Continuous Delivery?

Page 9: Challenges and best practices of database continuous delivery

What is CD? Product Delivery Pipeline

Requirements Develop Build Test Integrate Deploy

Page 10: Challenges and best practices of database continuous delivery

BuildRequirements Develop IntegrateTest Deploy

Rqmts Doc Licenses/IP History

SocialCoding

BuildFarms

Database Scripts “Hardware”(Virtual)

Code OpenSource

Binaries Release Binaries

Code OpenSource Binaries Release BinariesDatabase

Product Delivery Pipeline

Page 11: Challenges and best practices of database continuous delivery

BuildRequirements Develop IntegrateTest Deploy

Rqmts Doc Licenses/IP History

SocialCoding

BuildFarms

Scripts “Hardware”(Virtual)

Code OpenSource

Team Collaboration (design, dev, release, devops…)

Binaries Release BinariesDatabase

Accelerate the Pipeline (code, DB, scripts, binaries, etc.)

Product Delivery Pipeline

Page 12: Challenges and best practices of database continuous delivery

Less Efficient Product Delivery

Poor visibility between teams introduce friction and design errors

Poor component reuse results in higher production cost

More delays, less efficient product delivery

Increased risk of quality issues

DevOps

Page 13: Challenges and best practices of database continuous delivery

A Single Source of Truth

Page 14: Challenges and best practices of database continuous delivery

Continuous Delivery Best Practice

Keep everything in version control… this includes requirement documents, test scripts, automated test cases, network configuration scripts, deployment scripts, database creation…

- Continuous Delivery by Jez Humble and David Farley

““

Page 15: Challenges and best practices of database continuous delivery

Modern Version Management

Page 16: Challenges and best practices of database continuous delivery

Hybrid Workflows• Distributed & Centralized Version control,

code reviews, simple file sharing• Happy developers & contributors

Every File• Efficiently handles large, often binary, data

DevOps Stay Happy & Productive• A mainline source for all builds even with

distributed development

All IP Safe & Secure • Granular permissions, theft risk monitoring

Perforce Helix

CONTRIBUTORS

CONSUMERS

Page 17: Challenges and best practices of database continuous delivery

Perforce Manages IP for Market Leaders

13,000 20,000 users

9,500 users500+ terabytes

5,000+ userscoders & designers

10,000,000 Perforce xact/day

Everything! 11,000+ users

Chips Games & Animation Cloud/SW Electronics Systems Automotive

And > 15,000 other companies across industries

Page 18: Challenges and best practices of database continuous delivery

Facts– Fortune 1000 (IDC)

▪Average total cost of unplanned application downtime per year is $1.25b - $2.5b

Hourly cost of an infrastructure failure is $100K/hour to $500K – $1 M

Average number of deployments/month is expected to double in two years

DevOps-led projects will accelerate the delivery of capabilities to the customer by 15%–20%

Continuous Delivery is required!

Page 19: Challenges and best practices of database continuous delivery

But…what about the

database?

Page 20: Challenges and best practices of database continuous delivery

Continuous Delivery is big and getting bigger

Dzone recent study…

* Dzone guide to continuous delivery, 2015 edition

Page 21: Challenges and best practices of database continuous delivery

What about the database?

Page 22: Challenges and best practices of database continuous delivery

▪ Based on the survey questions, only 13% from the ones reported doing CD for DB, are actually performing basic CD practices!!!

The rest are plugging the automated process withvarious manual steps…

▪ Why?▪ What is so special about the database?

Not 49%, actually DOWN to 13% !!!

Page 23: Challenges and best practices of database continuous delivery

Mostly manual implementation

So? What is the problemwith manual implementation?

Page 24: Challenges and best practices of database continuous delivery

Manual steps in an automated process don’t work!!

1. At first, you think “This is easy. We can handle it!”2. Then “I think we’re fighting a losing battle…”3. And then you have to double your speed !!!

Page 25: Challenges and best practices of database continuous delivery

Also, manual steps lead to Chaos in Emergency Times

90%Rate this as a risk factor, but

53%Break the process and test urgent hot-fixes in pre-

production

Page 26: Challenges and best practices of database continuous delivery

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

Is database the Weakest link in a chain ???

Page 27: Challenges and best practices of database continuous delivery

The Database is a constraint

Page 28: Challenges and best practices of database continuous delivery

What is the problem?

▪Root Causes for issues:− Challenging manual source control process− Static deployments code overrides− Dynamic deployments tools unaware of version control− No release automation red-flags – don’t know when to stop the

line…

Page 29: Challenges and best practices of database continuous delivery

Version Control Process (file based)

Database

Check-Out Script

Modify Script

Get updated Script from DB

Check-In Script

Compile

Scriptin DB

Debug

Scriptin DB

?

??

?

A

A’

Traditional isolated processes

Risk of falling out of sync

Page 30: Challenges and best practices of database continuous delivery

90%Rate this as a risk factor, yet

72%Admit database may not be in sync with the source

repository

Page 31: Challenges and best practices of database continuous delivery

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 upgrade script− The actual code of the object− A roll-back script

Page 32: Challenges and best practices of database continuous delivery

Modern VC integrated process

Page 33: Challenges and best practices of database continuous delivery

X1.11.1.11.11.21.31.41.51.61.7

Scripts… build once deploy many

Int QA Stage 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

XX

XXX

? 1.1.1

X

a

a

Page 34: Challenges and best practices of database continuous delivery

60%Of those manually building scripts have to fix

or tweak them regularly as part of a deployment process

Page 35: Challenges and best practices of database continuous delivery

80%Rate this as a risk factor, yet

71%Follow manual processes to create their database

deploy scripts

Page 36: Challenges and best practices of database continuous delivery

Build & deploy on demand

1.11.21.31.41.51.61.7

*

Int QA Stage Prod

Database Deploy Script

Environment* Execute the same script being

executed at the Stage environmentRe-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.1 1.4

1.4 1.7

1.1.1 1.7

1.1 1.1 1.11.41.7

File Based Version Control

Out of Process Change

1.1.11.7 1.1.11.7

Validate

Page 37: Challenges and best practices of database continuous delivery

Safe to automate?(?)

Compare & sync tools

Page 38: Challenges and best practices of database continuous delivery

Challenges…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…

We fear for automating problems into production and a major risk!!!

Page 39: Challenges and best practices of database continuous delivery

70%of those using compare & sync tools have to

review and fix the results as they can't always trust them to automatically deploy correctly

Page 40: Challenges and best practices of database continuous delivery

■ Understand the nature of the changes

■ Raise red flags on conflicts ■ Support out-of-process changes■ Utilize baseline aware analysis

Safety Net Deployment Automation

Page 41: Challenges and best practices of database continuous delivery

Deploying changes if neededDevelopment 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 42: Challenges and best practices of database continuous delivery

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 43: Challenges and best practices of database continuous delivery

Dealing with conflicts => merging changes

Page 44: Challenges and best practices of database continuous delivery

Conflict Resolving – Meta Data/Content

Page 45: Challenges and best practices of database continuous delivery

Impact Analysis

Page 46: Challenges and best practices of database continuous delivery

Impact Analysis! not Damage Control…

Raise red flags to stop the line… before actual deployment…

if requires human intervention

Page 47: Challenges and best practices of database continuous delivery

Automate “everything”– Package the deployment of database changes along with all

your other application components to give a unified picture Move the process upstream

– Easily promote the same package (including database changes!) from one environment to the next, handling environment-specific differences automatically

Create the deployment pipeline

For successful CD:

Page 48: Challenges and best practices of database continuous delivery

What does DBmaestro offer?▪ Database Enforced Change Management solution

– Database source control– Enforce best practices– Plugs into Perforce– Database merge & change impact analysis

▪ DevOps & CD Solution for databases– Baseline aware deployment automation, rollback & recovery– Reduce database deployment issues– Plugs into release management & Continuous Delivery

▪ Security– Control roles & responsibilities when introducing DB changes

▪ Audit & Compliance– Know who can do what, where, when & why

Allows you to package, verify, deploy and promote database changes just as you would do

with application code… putting you in a position

to build a full delivery pipeline…

Page 49: Challenges and best practices of database continuous delivery

▪ Focusing on changes rather than managing changes and dealing with re-work, boosted overall productivity of 250 developers. We estimate we were able to do 15% more with the same resources.

▪We went from several fix-centric deployments a day, to one feature-centric deployment a week.▪The amount of incidents in production has declined as well. We had 20% less incidents. ▪CIO @ Credit Card company

“Testimonials - Efficiency

Page 50: Challenges and best practices of database continuous delivery

About DBmaestro

▪The leading provider of DevOps for Database▪Database Development and Continuous Delivery