Continuous Database Delivery

24
Domesticating Databases: Continuous Database Delivery Wes Higbee www.weshigbee.com @g0t4

Transcript of Continuous Database Delivery

Domesticating Databases: Continuous Database Delivery

• Wes Higbee

• www.weshigbee.com

• @g0t4

Shared Dev DB

SharedDev

Prod

Images in this slide deck are from presentermedia.com, images may not be redistributed

Refactoring discouraged

Debug nightmare

What changed?

Who

Why

Network drops

Remote workStepping on toes

Drawbacks of Shared Dev DB

Easily share changes

Beefy server

Environment like prod

No DB setup

Advantages of Shared Dev DB

What Changed?

ProdShared

Dev

• Prod• Dev

Path Matters

PeopleName

AddressMailingAddress

PeopleName

Address PeopleName

MailingAddress

Delayed releaseAnxietyMistakes

Data changesNo who, why, how,

whenPath matters

How?

Problems with Waiting

Continuous Database Delivery – Part 1

sql

Add color.sql

car color

car color

Part 1 – Track and Apply

• Payroll DB - greenfield

• Setup dedicated dev DB

• Create employees table

What You Will Build

What You Will Build

What You Will Build

What You Will Build

Continuous Database Delivery – Part 1

Dev Workflow

BEFORE

DEV

DEV CHANGED

DEV

DEV

AFTER

BEFORE BEFORE / AFTER

Reverse EngineerChangesWorkflow

BEFORE

COMPARE

AFTER

DEV

AFTER?

Safely Pulling Changes

BEFORE

DEV

DEV

BEFORE

Two Cooks in the Kitchen

1 2 3 4

5?

5?

5 6

• Check when you pull• Bump your version• Fix your dev DB

• Backup • Test• Push

6?

Manual Releases

ProdShared

Dev

Lack of feedback and testing

Test in productionEnvironments

misaligned

Significant downtime

Silos of responsibility

Mistakes

Problems with Manual Releases

Continuous Database Delivery – Part 2

Prod

TEST

DEV DB Continuous Integration

CI – Drop and Create

Pre Test Release

DEV DBContinuous Integration

PROD Backup

TeamCity Setup

Build

Drop/Create DB

flyway migrateci drop and create.bat