Continuous Delivery for Databases 
SQL Relay – Cardiff - 2014 
Presented by: James Smith 
Co-Founder, DevOpsGuys
Who is this guy? 
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!
ABOUT DEVOPSGUYS 
We provide 
web 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?
Why is this important? 
WHY?
Why is this important? 
WHY?
BUSINESS HAS CHANGED
SPEED MATTERS
8
DEPLOYMENT RATES 
9 
300 Deployments / Year 
10+ Deployments / Day 
50-60 Deployments / Day 
Every 11.6 seconds
HIGH PERFORMERS 
HIGH PERFORMING IT 
ORGANISATIONS DEPLOY 30 TIMES 
MORE FREQUENTLY, WITH 50% 
FEWER FAILURES WITH 8000X 
FASTER LEAD TIMES THAN THEIR 
PEERS. 
10
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 
11
How have things changed? 
HOW? 
12
2010 
2012 
DEV HAS CHANGED 
2001 (1998) 
2001 (and earlier)
WE KNOW AGILE WORKS
CONTINUOUS X? 
Plan Code Build Test Release Deploy Operate 
15 
Continuous Integration 
Continuous Delivery 
Continuous Deployment
What is it? 
CONTINUOUS DELIVERY
Matthew Skelton 
REGULAR, RAPID, RELIABLE AND 
CONTROLLED DELIVERY OF 
WORKING SOFTWARE SYSTEMS 
INTO PRODUCTION
Matthew Skelton 
REGULAR, RAPID, RELIABLE AND 
CONTROLLED DELIVERY OF 
WORKING SOFTWARE SYSTEMS INTO 
PRODUCTION
Nhan Ngo, a QA engineer at Spotify
CONTINUOUS DELIVERY 
1. Build Management & CI 
2. Environments & Deployment 
3. Release Management & Compliance 
4. Testing 
5. Data Management 
20
BUT DATABASE CHANGE IS 
SCARY 
22 
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
NO, THIS IS SCARY 
Photo Credit: ?
SO WE MINIMISE RISK 
Photo Credit: https://ideas.lego.com/projects/62456
WE DEFEND THE THREAT 
Photo Credit: "Rumrunner" via Compfight cc
WE STOP CHANGE 
26 
Photo Credit: s.kosoris via Compfight cc
CUSTOMERS GET SAD 
27 
Photo Credit: Kalexanderson via Compfight cc
THE BUSINESS GETS ANGRY 
28 
Photo Credit: powerpig builds via Compfight cc
AND IT GET THE BLAME! 
29 
Photo Credit: bobsfever via Compfight cc
YES BUT…. 
Dev are shipping application changes – frequently 
Ops are creating servers - automatically 
30
Perfectly normal question 
WHY IS THERE SO MUCH LEGO 
IN YOUR SLIDE DECK?
LEGO = DEVOPS 
Rapid proto-typing & experimentation 
Building blocks – no right or wrong way 
Promotes collaboration 
Strong cultural appeal 
Small batch sizes 
Visibly measureable 
We’ve even automated it! 
 Manufacturing 
 Zenon 
 Mindstorms 
Danish phrase leg godt, which means "play well".
Why is database automation so hard? 
WHY?
!= 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
What are the common challenges? 
WHAT?
#1: VERSION CONTROL 
Photo Credit: ntr23 via Compfight cc
VERSION CONTROL 
 Database changes not under VCS 
 Worse – Changes not “always” committed to VCS 
Communication of change 
Living in “the sea of ‘branch/merge’ filth”
#2: AGAINST THE FLOW 
38 
Photo Credit: slang589 via Compfight cc 
Photo Credit: slang589 via Compfight cc
AGAINST THE FLOW 
DEV PRODUCTION 
39 
DEV PRODUCTION 
CODE 
DATA
#3: COMPLEXITY 
40 
Photo Credit: L@go via Compfight cc
COMPLEXITY 
Dependence 
Centralisation
#4: DATA VOLUME 
Photo Credit: http://www.calgaryherald.com/news/calgary/Gallery+LEGO+KidsFest/9848406/story.html
DATA VOLUME 
Transit time 
Historical data – no archiving 
One of the biggest impacts on Cycle time
#5: CONWAY'S LAW 
Photo Credit: kirk_arts via Compfight cc
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 
45
CONWAY'S LAW 
Is (was) a database really needed? 3 Tiers anyone? 
Centralised vs Decentralised? 
Formalised [change] control
So what are some of the solutions? 
HOW?
#1: GET UNDER CONTROL 
Photo Credit: RHiNO NEAL via Compfight cc
VERSION CONTROL 
It’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
#2: INTEGRATE 
CONTINUOUSLY 
Photo Credit: ....Tim via Compfight cc 50
CONTINUOUS INTEGRATION 
 Automate your build steps (Full vs Incremental) 
Build a library of manual tests 
Automate your tests 
51
#3: AUTOMATE TESTING 
52 
Photo Credit: s3aphotography via Compfight cc
TEST, TEST, TEST 
Select the right tests for each stage; 
Unit testing 
 Integration Testing 
Deployment Validation 
Behaviour Validation 
Determine the right data for testing 
Do you need it all? 
53
#4: AUTOMATION 
Photo Credit: pasukaru76 via Compfight cc 54
AUTOMATE ALL THE THINGS 
Testing 
Deployment 
Back-up and more importantly restore 
Archiving 
Rollback 
55
#5: MICROSERVICES 
56
AS A SERVICE 
Treat your database as a service 
Contracts – that you do not break (lightly) 
57
RE-ARCHITECT 
Split data along sensible partitions 
Polyglot persistence 
58
POLYGLOT PERSISTENCE 
59
#6: CHANGE YOUR WAYS 
Photo Credit: Stéfan via Compfight cc 60
IT’S CULTURE 
Technology is only half of the story 
Dev’s must work with DBA’s (no silo’s) 
Management must think of operations as part of development 
Deployment is part of development 
Data retention is part of development 
Fail faster, but fail safely 
61
Can tools help? 
TOOLING 
62
THE PIPELINE 
Source 
Control 
Integration Test Deploy
IN REALITY 
64 
Development 
Operations 
Plan Code Build Test Release Deploy Operate
SOURCE CONTROL 
Source control is the foundation of Continuous Integration 
Plus many, many more
CONTINUOUS INTEGRATION 
Continuous Integration is the common orchestration point 
66
DEPLOYMENT 
Repeatable and consistent deployments every time. 
67
MONITORING 
Continuous delivery elevates the need for monitoring in production
THE TRUTH 
Continuous Delivery relies on having 2 basic things; 
1. Version Control 
2. Automation
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! 
70
EVERYBODY WINS! 
Photo Credit: Kalexanderson via Compfight cc 71
THAT’S ALL FOLKS 
Photo Credit: Walter Benson via Compfight cc 72

Continuous delivery for databases

  • 1.
    Continuous Delivery forDatabases SQL Relay – Cardiff - 2014 Presented by: James Smith Co-Founder, DevOpsGuys
  • 2.
    Who is thisguy? 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!
  • 3.
    ABOUT DEVOPSGUYS Weprovide web 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?
  • 4.
    Why is thisimportant? WHY?
  • 5.
    Why is thisimportant? WHY?
  • 6.
  • 7.
  • 8.
  • 9.
    DEPLOYMENT RATES 9 300 Deployments / Year 10+ Deployments / Day 50-60 Deployments / Day Every 11.6 seconds
  • 10.
    HIGH PERFORMERS HIGHPERFORMING IT ORGANISATIONS DEPLOY 30 TIMES MORE FREQUENTLY, WITH 50% FEWER FAILURES WITH 8000X FASTER LEAD TIMES THAN THEIR PEERS. 10
  • 11.
    HIGH PERFORMERS THEYARE ALSO TWO TIMES MORE LIKELY TO EXCEED PROFITABILITY, MARKET SHARE & PRODUCTIVITY GOALS THEY EXPERIENCE 50% HIGHER MARKET CAPITALIZATION GROWTH OVER 3 YEARS 11
  • 12.
    How have thingschanged? HOW? 12
  • 13.
    2010 2012 DEVHAS CHANGED 2001 (1998) 2001 (and earlier)
  • 14.
  • 15.
    CONTINUOUS X? PlanCode Build Test Release Deploy Operate 15 Continuous Integration Continuous Delivery Continuous Deployment
  • 16.
    What is it? CONTINUOUS DELIVERY
  • 17.
    Matthew Skelton REGULAR,RAPID, RELIABLE AND CONTROLLED DELIVERY OF WORKING SOFTWARE SYSTEMS INTO PRODUCTION
  • 18.
    Matthew Skelton REGULAR,RAPID, RELIABLE AND CONTROLLED DELIVERY OF WORKING SOFTWARE SYSTEMS INTO PRODUCTION
  • 19.
    Nhan Ngo, aQA engineer at Spotify
  • 20.
    CONTINUOUS DELIVERY 1.Build Management & CI 2. Environments & Deployment 3. Release Management & Compliance 4. Testing 5. Data Management 20
  • 22.
    BUT DATABASE CHANGEIS SCARY 22 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
  • 23.
    NO, THIS ISSCARY Photo Credit: ?
  • 24.
    SO WE MINIMISERISK Photo Credit: https://ideas.lego.com/projects/62456
  • 25.
    WE DEFEND THETHREAT Photo Credit: "Rumrunner" via Compfight cc
  • 26.
    WE STOP CHANGE 26 Photo Credit: s.kosoris via Compfight cc
  • 27.
    CUSTOMERS GET SAD 27 Photo Credit: Kalexanderson via Compfight cc
  • 28.
    THE BUSINESS GETSANGRY 28 Photo Credit: powerpig builds via Compfight cc
  • 29.
    AND IT GETTHE BLAME! 29 Photo Credit: bobsfever via Compfight cc
  • 30.
    YES BUT…. Devare shipping application changes – frequently Ops are creating servers - automatically 30
  • 31.
    Perfectly normal question WHY IS THERE SO MUCH LEGO IN YOUR SLIDE DECK?
  • 32.
    LEGO = DEVOPS Rapid proto-typing & experimentation Building blocks – no right or wrong way Promotes collaboration Strong cultural appeal Small batch sizes Visibly measureable We’ve even automated it!  Manufacturing  Zenon  Mindstorms Danish phrase leg godt, which means "play well".
  • 33.
    Why is databaseautomation so hard? WHY?
  • 34.
    != 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
  • 35.
    What are thecommon challenges? WHAT?
  • 36.
    #1: VERSION CONTROL Photo Credit: ntr23 via Compfight cc
  • 37.
    VERSION CONTROL Database changes not under VCS  Worse – Changes not “always” committed to VCS Communication of change Living in “the sea of ‘branch/merge’ filth”
  • 38.
    #2: AGAINST THEFLOW 38 Photo Credit: slang589 via Compfight cc Photo Credit: slang589 via Compfight cc
  • 39.
    AGAINST THE FLOW DEV PRODUCTION 39 DEV PRODUCTION CODE DATA
  • 40.
    #3: COMPLEXITY 40 Photo Credit: L@go via Compfight cc
  • 41.
  • 42.
    #4: DATA VOLUME Photo Credit: http://www.calgaryherald.com/news/calgary/Gallery+LEGO+KidsFest/9848406/story.html
  • 43.
    DATA VOLUME Transittime Historical data – no archiving One of the biggest impacts on Cycle time
  • 44.
    #5: CONWAY'S LAW Photo Credit: kirk_arts via Compfight cc
  • 45.
    CONWAY'S LAW "Anyorganization 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 45
  • 46.
    CONWAY'S LAW Is(was) a database really needed? 3 Tiers anyone? Centralised vs Decentralised? Formalised [change] control
  • 47.
    So what aresome of the solutions? HOW?
  • 48.
    #1: GET UNDERCONTROL Photo Credit: RHiNO NEAL via Compfight cc
  • 49.
    VERSION CONTROL It’scode – 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
  • 50.
    #2: INTEGRATE CONTINUOUSLY Photo Credit: ....Tim via Compfight cc 50
  • 51.
    CONTINUOUS INTEGRATION Automate your build steps (Full vs Incremental) Build a library of manual tests Automate your tests 51
  • 52.
    #3: AUTOMATE TESTING 52 Photo Credit: s3aphotography via Compfight cc
  • 53.
    TEST, TEST, TEST Select the right tests for each stage; Unit testing  Integration Testing Deployment Validation Behaviour Validation Determine the right data for testing Do you need it all? 53
  • 54.
    #4: AUTOMATION PhotoCredit: pasukaru76 via Compfight cc 54
  • 55.
    AUTOMATE ALL THETHINGS Testing Deployment Back-up and more importantly restore Archiving Rollback 55
  • 56.
  • 57.
    AS A SERVICE Treat your database as a service Contracts – that you do not break (lightly) 57
  • 58.
    RE-ARCHITECT Split dataalong sensible partitions Polyglot persistence 58
  • 59.
  • 60.
    #6: CHANGE YOURWAYS Photo Credit: Stéfan via Compfight cc 60
  • 61.
    IT’S CULTURE Technologyis only half of the story Dev’s must work with DBA’s (no silo’s) Management must think of operations as part of development Deployment is part of development Data retention is part of development Fail faster, but fail safely 61
  • 62.
    Can tools help? TOOLING 62
  • 63.
    THE PIPELINE Source Control Integration Test Deploy
  • 64.
    IN REALITY 64 Development Operations Plan Code Build Test Release Deploy Operate
  • 65.
    SOURCE CONTROL Sourcecontrol is the foundation of Continuous Integration Plus many, many more
  • 66.
    CONTINUOUS INTEGRATION ContinuousIntegration is the common orchestration point 66
  • 67.
    DEPLOYMENT Repeatable andconsistent deployments every time. 67
  • 68.
    MONITORING Continuous deliveryelevates the need for monitoring in production
  • 69.
    THE TRUTH ContinuousDelivery relies on having 2 basic things; 1. Version Control 2. Automation
  • 70.
    AND FINALLY… Customerssee results and new features more quickly. Shorter feedback cycles increases our ability to learn. Improve the whole system. Reduce firefighting. Everyone wins! 70
  • 71.
    EVERYBODY WINS! PhotoCredit: Kalexanderson via Compfight cc 71
  • 72.
    THAT’S ALL FOLKS Photo Credit: Walter Benson via Compfight cc 72

Editor's Notes

  • #7  Standard & Poor's 500, is a stock market index based on the market capitalizations of 500 large companies having common stock listed on the NYSE or NASDAQ. That’s a sign of just how fast computing is changing. But technological change may also be shortening the lifespan of all great companies.  Back in 1958, a company could expect to stay on the list for 61 years. These days, the average is just 18 years. No one really knows why the rate of turnover is speeding up, but technological disruption could be one big reason. Since 2002, Google, Amazon, and Netflix have joined the S&P 500, while Kodak, the New York Times, Palm and Compaq have all been forced off, essentially by changing technology.
  • #8 Look at why the companies on the right declined… They failed to realize the potential of an online revenue stream from a captive customer base Their technology and IT strategy was compromised by access to enough resource Customer expectations for service was disrupted by startups using new technology, they didn’t keep up In all cases, they were too slow to market or too slow to see the opportunity.
  • #9  He was chairman and CEO of General Electric between 1981 and 2001. During his tenure at GE, the company's value rose 4000% http://www.stratabridge.com/2012/01/the-growth-control-paradox/rate-of-change-jack-welch/
  • #10 http://www.slideshare.net/grabnerandi/london-web-perfugperformancefocuseddevopsfeb2014
  • #11 For those who get it
  • #14 2001 agile manifesto Kent Beck published about continuous integration in 1998. CruiseControl was released in 2001. 2010 – Farley & Humble 2012 – DevOps Mainstream
  • #23 So meet emmet, he’s just deployed some database change. Data is a risk. Database change is a risk.
  • #25 DBA group preparing for database deployment
  • #35 Its not copy and paste (replace) – as per code deployment
  • #38 Hotfixes made direct to environments Changes communicated via email, etc Lots of firefighting from merge conflicts
  • #40 Dev and Production - Data – Environmental Drift 'Production first' is also used for changes to schemas, reference data, and database logic, leading to 'drift' between the Production database and versions used by development and test teams. – Indexes for performance
  • #41 Rolls Royce Jet Engine
  • #42 central database that started out small and gradually grew to become highly unwieldy applications that depended upon it directly has grown the presence of all data in the same place was great for rapid development opaque legacy processes, organisational red-tape, or just inexperience.
  • #43 #4: Buried under data
  • #44 Sheer data size can also work against deployability. Large backups take a long time to run, transmit, and restore, preventing effective use of the database in upstream testing. In some systesm around 70-80% of the data held in the core transactional database was historical data that was rarely requested or use moving from 8hours for a backup/transmit/restore cycle to even 30 minutes makes a huge difference in a Continuous Delivery context
  • #46 Melvin Edward Conway was an early computer scientist, computer programmer, and hacker For example, if a development team is set up with a SQL database specialist, a JavaScript/CSS developer and a C# developer you they will produce a system with three tiers: a database with stored procedures, a business middle tier and a UI tier. a
  • #47 Are you getting a database because you have DBA’s Centralised DBA teams build centralised “MASTER” databases. And vice versa. Team split tendency to want to “protect the database” from the developers. ITIL, etc?
  • #50 Typically we see indexes being applied only to non-development systems
  • #51 Not sure why I used this photo. Do you know how hard it is to find lego pictures for continuous integration!!
  • #52 You should be able to assemble your full database from source control *full* You should be able to patch / upgrade your database (incremental) 3. You should be able to manually test its built
  • #59 a mix of languages to take advantage of the fact that different languages are suitable for tackling different problems
  • #60 a relational database where the data is relational, a graph database where the data is highly connected, a document database where the data is more document-like, and so on. http://martinfowler.com/bliki/PolyglotPersistence.html
  • #66 Team Collaboration Audit trail of changes Rollback to previous version
  • #70 Automate everything – every step All changes must be documented and stored in one place