Post on 08-Apr-2017
ABCDs of Database Development(Always Be Continuously Delivering)
Elizabeth Ayer, Redgate
Continuous Lifecycle London
May the 4th
@ElizAyer #ConLifecycleLon
1.What it is
2.Why you want it
3.Why you can’t have it
@ElizAyer #ConLifecycleLon
Continuous Delivery in 3 minutes
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
Don’t stockpile pain.
@ElizAyer #ConLifecycleLon
www.freerepublic.com/focus/news/2658403/posts
@ElizAyer #ConLifecycleLon
Version
ControlBuild
Release
ManagementValidation Production
Dev, Test, Review
@ElizAyer #ConLifecycleLon
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
@ElizAyer #ConLifecycleLon
Why you want CD
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
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
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
Demo!
@ElizAyer #ConLifecycleLon
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
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
Alternative approaches
1. Application controls database
2. Desired state
@ElizAyer #ConLifecycleLon
FAQs
Hotfixes?
Spinning up environments from scratch?
Zero-downtime?
…Wait, isn’t this scary?
@ElizAyer #ConLifecycleLon
@ElizAyer #ConLifecycleLon
or
?
Thank you!
@ElizAyer #ConLifecycleLon
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.
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/