abcds of database development

20
ABCDs of Database Development (Always Be Continuously Delivering) Elizabeth Ayer, Redgate Continuous Lifecycle London May the 4th @ElizAyer #ConLifecycleLon

Upload: elizabeth-ayer

Post on 08-Apr-2017

336 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: ABCDs of Database Development

ABCDs of Database Development(Always Be Continuously Delivering)

Elizabeth Ayer, Redgate

Continuous Lifecycle London

May the 4th

@ElizAyer #ConLifecycleLon

Page 2: ABCDs of Database Development

1.What it is

2.Why you want it

3.Why you can’t have it

@ElizAyer #ConLifecycleLon

Continuous Delivery in 3 minutes

Page 3: ABCDs of Database Development

Continuous Delivery is a set of software

development practices which ensure that

software remains releasable at all times. It is

based on continuous integration, and

automated build, test and deployment.

@ElizAyer #ConLifecycleLon

Page 4: ABCDs of Database Development

Don’t stockpile pain.

@ElizAyer #ConLifecycleLon

Page 5: ABCDs of Database Development

www.freerepublic.com/focus/news/2658403/posts

@ElizAyer #ConLifecycleLon

Page 6: ABCDs of Database Development

Version

ControlBuild

Release

ManagementValidation Production

Dev, Test, Review

@ElizAyer #ConLifecycleLon

Page 7: ABCDs of Database Development

Source: 2015 State of DevOps Report, Puppet Labs https://puppet.com/resources/white-paper/2015-state-of-devops-report

@ElizAyer #ConLifecycleLon

Why the business wants DevOps

Page 8: ABCDs of Database Development

@ElizAyer #ConLifecycleLon

Why you want CD

Page 9: ABCDs of Database Development

Databases as a bottleneck

3 reasons why databases have traditionally slowed down

deployments:

Technology lag

SQL

CI systems

DBA paranoia

Frankly…

1 2 3

@ElizAyer #ConLifecycleLon

Data persistence

Data outlives

applications

Data can’t be

replaced

Page 10: ABCDs of Database Development

Version control becomes the source of truth

~~~~

Development uses production-like environments

~~~~

Changes are reviewed at design time

~~~~

Nobody changes the database by hand

Database CD: the rules

@ElizAyer #ConLifecycleLon

Page 11: ABCDs of Database Development

Application vs Database CD

Application Database

What you check in: Code Migrations(or database state)

What ‘build’ means: Compile, link, etc. Validate by running migrations

What you test in CI: Unit test Upgrade data checks(and unit test db logic)

When you deploy: Replace application Run migrations

More like infrastructure code than application code….

@ElizAyer #ConLifecycleLon

Page 12: ABCDs of Database Development

Demo!

@ElizAyer #ConLifecycleLon

Page 13: ABCDs of Database Development

Scenario

@ElizAyer #ConLifecycleLon

Continuous

Integration

TicketDeskDev1 TicketDeskMyTest TicketDeskCI

Version

Control

1. Design change: table split

2. Validate change locally: table split

3. Validate change on CI database

Page 14: ABCDs of Database Development

Scenario

@ElizAyer #ConLifecycleLon

Jenkins

TicketDeskDev1 TicketDeskMyTest TicketDeskCI

Git

1. Design change: table split

2. Validate change locally: table split

3. Validate change on CI database

Flyway

Page 15: ABCDs of Database Development

Alternative approaches

1. Application controls database

2. Desired state

@ElizAyer #ConLifecycleLon

Page 16: ABCDs of Database Development

FAQs

Hotfixes?

Spinning up environments from scratch?

Zero-downtime?

…Wait, isn’t this scary?

@ElizAyer #ConLifecycleLon

Page 17: ABCDs of Database Development

@ElizAyer #ConLifecycleLon

or

?

Page 18: ABCDs of Database Development

Thank you!

@ElizAyer #ConLifecycleLon

Page 19: ABCDs of Database Development

Original Abstract

• Databases often sit outside Continuous Delivery for a variety of reasons, good and bad. But if you want fast and reliable deployments, the database cannot remain separate. We’ll talk through the challenges and look at tools to automate database delivery, highlighting open source options. I’ll live demo a database change flowing to ‘production,’ giving a clear picture of a fully automated process. The session is for developers, ops people, and managers, who will come out understanding how to customise practices and toolsets, building a pipeline suited to their environment. The result will accelerate database delivery, while protecting the organisation’s most valuable asset: its data.

Page 20: ABCDs of Database Development

Image CreditsSlide 5: Kudzu picture via www.freerepublic.com/focus/news/2658403/posts

Slides 6, 13, 14: Icons made by Dave Gandy and Freepik from www.flaticon.com, CC BY 3.0 license

Slide 7: Data table from 2015 State of DevOps Report, Puppet Labs https://puppet.com/resources/white-paper/2015-state-of-devops-report

Slide 8: Screenshot of https://www.gov.uk/service-manual/agile/continuous-delivery.html

Slide 17: Plutonium handling picture from http://www.dsnews.ua/future/pyat-innovatsiy-proshloy-nedeli-kotorye-vy-mogli-propustit-27122015201700

Simpsons picture from http://showbizgeek.com/the-simpsons-final-episode-the-perfect-ending/