72
Continuous Delivery for Databases SQL Relay – Cardiff - 2014 Presented by: James Smith Co-Founder, DevOpsGuys

Continuous delivery for databases

Embed Size (px)

Citation preview

Page 1: Continuous delivery for databases

Continuous Delivery for DatabasesSQL Relay – Cardiff - 2014

Presented by: James SmithCo-Founder, DevOpsGuys

Page 2: Continuous delivery for databases

ABOUT ME

Co-founder @ DevOpsGuys

Two decades building & delivering enterprise web systems

Helped many, many companies implement Continuous Delivery practices

Found High Quality Belgian Beer in late nineties!

Who is this guy?

Page 3: Continuous delivery for databases

ABOUT DEVOPSGUYS

We provideweb application management

for customers, giving them access to the expertise necessary for building, launching, maintaining & optimising applications

allowing them to accelerate time-to-market

and to focus on adding value to their business

Who are these guys?

Page 4: Continuous delivery for databases

WHY?Why is this important?

Page 5: Continuous delivery for databases

WHY?Why is this important?

Page 6: Continuous delivery for databases

BUSINESS HAS CHANGED

Page 7: Continuous delivery for databases

SPEED MATTERS

Page 8: Continuous delivery for databases

8

Page 9: Continuous delivery for databases

9

DEPLOYMENT RATES

300 Deployments / Year

50-60 Deployments / Day10+ Deployments / Day

Every 11.6 seconds

Page 10: Continuous delivery for databases

10

HIGH PERFORMERS HIGH PERFORMING IT

ORGANISATIONS DEPLOY 30 TIMES MORE FREQUENTLY, WITH 50% FEWER FAILURES WITH 8000X

FASTER LEAD TIMES THAN THEIR PEERS.

Page 11: Continuous delivery for databases

11

HIGH PERFORMERS THEY ARE ALSO TWO TIMES MORE LIKELY TO

EXCEED PROFITABILITY, MARKET SHARE & PRODUCTIVITY GOALS

THEY EXPERIENCE 50% HIGHER MARKET CAPITALIZATION GROWTH OVER 3 YEARS

Page 12: Continuous delivery for databases

HOW?How have things changed?

12

Page 13: Continuous delivery for databases

20102012

2001 (1998)

2001 (and earlier)

DEV HAS CHANGED

Page 14: Continuous delivery for databases

WE KNOW AGILE WORKS

Page 15: Continuous delivery for databases

15

Plan

Code

Build

Test

Release

Deploy

Operate

CONTINUOUS X?

Continuous Integration

Continuous Delivery

Continuous Deployment

Page 16: Continuous delivery for databases

CONTINUOUS DELIVERYWhat is it?

Page 17: Continuous delivery for databases

REGULAR, RAPID, RELIABLE AND CONTROLLED DELIVERY OF WORKING SOFTWARE SYSTEMS INTO PRODUCTION

Matthew Skelton

Page 18: Continuous delivery for databases

REGULAR, RAPID, RELIABLE AND CONTROLLED DELIVERY OF WORKING SOFTWARE SYSTEMS INTO PRODUCTION

Matthew Skelton

Page 20: Continuous delivery for databases

20

CONTINUOUS DELIVERY1. Build Management & CI2. Environments & Deployment3. Release Management & Compliance4. Testing5. Data Management

Page 21: Continuous delivery for databases
Page 22: Continuous delivery for databases

22

BUT DATABASE CHANGE IS SCARY

Photo Credit: http://cache.lego.com/r/www/r/movie/-/media/franchises/the%20lego%20movie/explore/downloads/wallpapers/lego_wps_1600_emmet.jpg?l.r=-1410608028

Page 23: Continuous delivery for databases

NO, THIS IS SCARY

Photo Credit: ?

Page 24: Continuous delivery for databases

SO WE MINIMISE RISK

Photo Credit: https://ideas.lego.com/projects/62456

Page 25: Continuous delivery for databases

WE DEFEND THE THREAT

Photo Credit: "Rumrunner" via Compfight cc

Page 30: Continuous delivery for databases

30

YES BUT…. Dev are shipping application changes – frequently

Ops are creating servers - automatically

Page 31: Continuous delivery for databases

WHY IS THERE SO MUCH LEGO IN YOUR SLIDE DECK?

Perfectly normal question

Page 32: Continuous delivery for databases

LEGO = DEVOPS

Rapid proto-typing & experimentationBuilding blocks – no right or wrong wayPromotes collaborationStrong cultural appealSmall batch sizesVisibly measureableWe’ve even automated it! Manufacturing Zenon Mindstorms

Danish phrase leg godt, which means "play well".

Page 33: Continuous delivery for databases

WHY?Why is database automation so hard?

Page 34: Continuous delivery for databases

!= CTRL C, CTRL V Database deployment is not copying and replacing.

It is the transformation from a previous version to the next version while preserving data integrity.

Deploying database change is hard

Deploying database change frequently is even harder

Page 35: Continuous delivery for databases

WHAT?What are the common challenges?

Page 37: Continuous delivery for databases

VERSION CONTROL Database changes not under VCS Worse – Changes not “always” committed to VCSCommunication of changeLiving in “the sea of ‘branch/merge’ filth”

Page 39: Continuous delivery for databases

39

AGAINST THE FLOW

DEV PRODUCTION

DEV PRODUCTION

CODE

DATA

Page 41: Continuous delivery for databases

COMPLEXITYDependenceCentralisation

Page 43: Continuous delivery for databases

DATA VOLUMETransit timeHistorical data – no archivingOne of the biggest impacts on Cycle time

Page 45: Continuous delivery for databases

45

CONWAY'S LAW "Any organization that designs a system (defined more broadly

here than just information systems) will inevitably produce a design whose structure is a copy of the organization's communication

structure.“ - Conway, 1968

Page 46: Continuous delivery for databases

CONWAY'S LAWIs (was) a database really needed? 3 Tiers anyone?

Centralised vs Decentralised?

Formalised [change] control

Page 47: Continuous delivery for databases

HOW?So what are some of the solutions?

Page 49: Continuous delivery for databases

VERSION CONTROLIt’s code – it should be in VCS!It’s code – it should be in VCS!It’s code – it should be in VCS!

Schema & Static/Reference Data

Reverse engineer existing schema & reference data

Page 51: Continuous delivery for databases

51

CONTINUOUS INTEGRATION Automate your build steps (Full vs Incremental)

Build a library of manual tests

Automate your tests

Page 52: Continuous delivery for databases

52

#3: AUTOMATE TESTING

Photo Credit: s3aphotography via Compfight cc

Page 53: Continuous delivery for databases

53

TEST, TEST, TESTSelect the right tests for each stage;Unit testing Integration TestingDeployment ValidationBehaviour Validation

Determine the right data for testingDo you need it all?

Page 55: Continuous delivery for databases

55

AUTOMATE ALL THE THINGSTestingDeploymentBack-up and more importantly restoreArchivingRollback

Page 56: Continuous delivery for databases

56

#5: MICROSERVICES

Page 57: Continuous delivery for databases

57

AS A SERVICE Treat your database as a service

Contracts – that you do not break (lightly)

Page 58: Continuous delivery for databases

58

RE-ARCHITECT Split data along sensible partitions

Polyglot persistence

Page 59: Continuous delivery for databases

59

POLYGLOT PERSISTENCE

Page 61: Continuous delivery for databases

61

IT’S CULTURE

Technology is only half of the storyDev’s must work with DBA’s (no silo’s)Management must think of operations as part of developmentDeployment is part of developmentData retention is part of developmentFail faster, but fail safely

Page 62: Continuous delivery for databases

TOOLINGCan tools help?

62

Page 63: Continuous delivery for databases

THE PIPELINESource

Control

Integration

Test Deploy

Page 64: Continuous delivery for databases

64

IN REALITYDevelopment

Plan Code Build Test Release Deploy Operate

Operations

Page 65: Continuous delivery for databases

SOURCE CONTROL Source control is the foundation of Continuous Integration

Plus many, many more

Page 66: Continuous delivery for databases

66

CONTINUOUS INTEGRATION Continuous Integration is the common orchestration point

Page 67: Continuous delivery for databases

67

DEPLOYMENT Repeatable and consistent deployments every time.

Page 68: Continuous delivery for databases

MONITORING Continuous delivery elevates the need for monitoring in production

Page 69: Continuous delivery for databases

THE TRUTH Continuous Delivery relies on having 2 basic things;

1. Version Control

2. Automation

Page 70: Continuous delivery for databases

70

AND FINALLY…Customers see results and new features more quickly.Shorter feedback cycles increases our ability to learn.Improve the whole system.Reduce firefighting.Everyone wins!

Page 72: Continuous delivery for databases

72

THAT’S ALL FOLKS

Photo Credit: Walter Benson via Compfight cc