continuous delivery: the dirty detailsgotocon.com/dl/goto-aar-2012/slides/mikebrittain... ·...

117
CONTINUOUS DELIVERY: THE DIRTY DETAILS Mike Brittain Etsy.com @mikebrittain [email protected]

Upload: others

Post on 27-Jun-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

CONTINUOUS DELIVERY:THE DIRTY DETAILS

Mike BrittainEtsy.com

@[email protected]

Page 2: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

a.k.a. “Continuous Deployment”

Page 3: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve
Page 4: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

www. .com

Page 5: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve
Page 6: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

AUGUST 20121.4 Billion page viewsUSD $76 Million in transactions3.8 Million items sold

http://www.etsy.com/blog/news/2012/etsy-statistics-august-2012-weather-report/

Page 7: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

~170 Committers, everyone deploys

credit: martin_heigan (flickr)

Page 8: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Very end of 2009Today

30

20

10

40

Page 9: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Continuous delivery is a pattern language in growing use in software development to improve the process of software delivery. Techniques such as automated testing, continuous integration, and continuous deployment allow software to be developed to a high standard and easily packaged and deployed to test environments, resulting in the ability to rapidly, reliably and repeatedly push out enhancements and bug fixes to customers at low risk and with minimal manual overhead. The technique was one of the assumptions of extreme programming but at an enterprise level has developed into a discipline of its own, with job descriptions for roles such as "buildmaster" calling for CD skills as mandatory. ~wikipedia

Page 10: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

+ DevOps+ Working on mainline, trunk, master+ Feature flags+ Branching in code

Page 11: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

An Apology

Page 12: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

We build primarily in PHP.Please don’t run away!

An Apology

Page 13: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

“Continuous Deploymentin Practice at Etsy”

The Dirty Details of...

Page 14: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve
Page 15: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

2010-today2009Then Now

Just before we started using CD

Page 16: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

15 mins6-14 hoursThen

1 person“Deployment Army”

Now

Rapid releasecycle

Highly orchestratedand infrequent

Page 17: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Commonplace andhappens so often

we cannot keep up

Special event andhighly disruptive

Then Now

Page 18: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Blocked for15 minutes,

next deploy willonly take

15 minutes

Config flags <5 mins

Blocked for6-14 hours,

plus minimum of6 hours toredeploy

Then Now

Page 19: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Mainline,minimal linking

and building,rsync,site up

Release branch,database schemas,

data transforms,packaging,

rolling restarts,cache purging,

scheduled downtime

Then Now

Page 20: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

FastSimple

Common

SlowComplexSpecial

Then Now

Page 21: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Deploying code is the very first thingengineers learn to do at Etsy.

Page 22: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

1st dayAdd your photo to Etsy.com.

Page 23: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

2nd dayComplete tax, insurance, and benefits forms.

1st dayAdd your photo to Etsy.com.

Page 24: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve
Page 25: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

WARNING

Page 26: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve
Page 27: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Continuous DeploymentSmall, frequent changes.

Constantly integrating into production.30 deploys per day.

Page 28: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

“Wow... 30 deploys a day.How do you build features so quickly?”

Page 29: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Software Deploy ≠ Product Launch

Page 30: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Deploys frequently gated by config flags(“dark” releases)

Page 31: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

$cfg[‘new_search’] = array('enabled' => 'off');$cfg[‘sign_in’] = array('enabled' => 'on');$cfg[‘checkout’] = array('enabled' => 'on');$cfg[‘homepage’] = array('enabled' => 'on');

Page 32: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

$cfg[‘new_search’] = array('enabled' => 'off');

Page 33: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

$cfg[‘new_search’] = array('enabled' => 'off');

// Meanwhile...

# old and boring search$results = do_grep();

Page 34: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

$cfg[‘new_search’] = array('enabled' => 'off');

// Meanwhile...

if ($cfg[‘new_search’] == ‘on’) { # New and fancy search $results = do_solr();} else { # old and boring search $results = do_grep();}

Page 35: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

$cfg[‘new_search’] = array('enabled' => 'on');

// or...

$cfg[‘new_search’] = array('enabled' => 'staff');

// or...

$cfg[‘new_search’] = array('enabled' => '1%');

// or...

$cfg[‘new_search’] = array('enabled' => 'users', 'user_list' => 'mike,john,kellan');

Page 36: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Validate in production, hidden from public.

Page 37: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Small incremental changes to the applicationNew classes, methods, controllersGraphics, stylesheets, templatesCopy/content changes

Turning flags on/off, or ramping up

What’s in a deploy?

Page 38: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Security, bugs, traffic, load shedding,adding/removing infrastructure.

Tweaking config flags or releasing patches.

Quickly Responding to issues

Page 39: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

http://www.flickr.com/photos/flyforfun/2694158656/

Page 40: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

http://www.flickr.com/photos/flyforfun/2694158656/

OperatorConfig flags

Metrics

Page 41: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve
Page 42: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve
Page 43: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

“How do you continuously deploy database schema changes?”

Page 44: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Code deploys: ~ every 15-20 minutesSchema changes: Thursday

Page 45: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Our web application is largely monolithic.

Page 46: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Etsy.com, support tools, developer API,back-office, analytics

Page 47: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

External “services” are not deployed with the main application.

Page 48: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Databases, Search, Photo storage

Page 49: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

For every config flag, there are two stateswe can support — forward and backward.

Page 50: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Expose multiple versions in each service.Expect multiple versions in the application.

Page 51: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Example: Changing a Database Schema

Page 52: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Prefer ADDs over ALTERs (“non-breaking expansions”)

Page 53: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Altering in-place requires couplingcode and schema changes.

Page 54: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Merging “users” and “users_prefs”

Page 55: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

1. Write to both versions2. Backfill historical data3. Read from new version4. Cut-off writes to old version

Page 56: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

0. Add new version to schema1. Write to both versions2. Backfill historical data3. Read from new version4. Cut-off writes to old version

Page 57: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

0. Add new version to schemaSchema change to add prefs columns to “users” table.

“write_prefs_to_user_prefs_table” => “on”“write_prefs_to_users_table” => “off”“read_prefs_from_users_table” => “off”

Page 58: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

1. Write to both versionsWrite code for writing prefs to the “users” table.

“write_prefs_to_user_prefs_table” => “on”“write_prefs_to_users_table” => “on”“read_prefs_from_users_table” => “off”

Page 59: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

2. Backfill historical dataOffline process to sync existing data from “user_prefs”to new columns in “users”

Page 60: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

3. Read from new versionData validation tests. Ensure consistency both internallyand in production.

“write_prefs_to_user_prefs_table” => “on”“write_prefs_to_users_table” => “on”“read_prefs_from_users_table” => “staff”

Page 61: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

3. Read from new versionData validation tests. Ensure consistency both internallyand in production.

“write_prefs_to_user_prefs_table” => “on”“write_prefs_to_users_table” => “on”“read_prefs_from_users_table” => “1%”

Page 62: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

3. Read from new versionData validation tests. Ensure consistency both internallyand in production.

“write_prefs_to_user_prefs_table” => “on”“write_prefs_to_users_table” => “on”“read_prefs_from_users_table” => “5%”

Page 63: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

3. Read from new versionData validation tests. Ensure consistency both internallyand in production.

“write_prefs_to_user_prefs_table” => “on”“write_prefs_to_users_table” => “on”“read_prefs_from_users_table” => “on”

(“on” == “100%”)

Page 64: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

4. Cut-off writes to old versionAfter running on the new table for a significant amount of time, we can cut off writes to the old table.

“write_prefs_to_user_prefs_table” => “off”“write_prefs_to_users_table” => “on”“read_prefs_from_users_table” => “on”

Page 65: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

“Branch by Astraction”

Controller Controller

Users Model

“users” (old) “user_prefs” “users”

old schema new schema

(Abstraction)

http://paulhammant.com/blog/branch_by_abstraction.htmlhttp://continuousdelivery.com/2011/05/make-large-scale-changes-incrementally-with-branch-by-abstraction/

Page 66: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

1. Write to both versions2. Backfill historical data3. Read from new version4. Cut-off writes to old version

“The Migration 4-Step”

Page 67: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

1. Write to both versions2. Backfill historical data3. Read from new version4. Cut-off writes to old version5. Clean up flags, code, columns (when?)

“The Migration 4-Step”

Page 68: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Architecture and Process

Page 69: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Deploying is cheap.

Page 70: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Some philosophies on product development...

Page 71: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Gathering data should be cheap, too.

staff, opt-in prototypes, 1%

Page 72: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Treat first iterations as experiments.

Page 73: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Get into code as quickly as possible.

Page 74: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Architecture largely doesn’t matter.

Page 75: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Kill things that don’t work.

Page 76: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

“Terminate with extreme predjudice.”

Page 77: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Is the dumb solution enough to build a product?How long will the dumb solution last?

Page 78: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Your assumptions will be wrongonce you’ve scaled 10x.

Page 79: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

“We don’t optimize for being right. We optimize for quickly detecting when we’re wrong.”

~Kellan Elliott-McCrea, CTO

Page 80: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Become really good at changingyour architecture.

Page 81: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Invest time in architecture by the2nd or 3rd iteration.

Page 82: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Integration and Operations

Page 83: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Continuous DeploymentSmall, frequent changes.

Constantly integrating into production.30 deploys per day.

Page 84: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Code review before commit

Page 85: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Automated tests before deploy

Page 86: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Why Integrate with Production?

Page 87: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Dev ≠ Prod

Page 88: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Verify frequently and in small batches.

Page 89: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Integrating with production is a test in itself.We do this frequently and in small batches.

Page 90: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

"Production is truly the only place youcan validate your code."

Page 91: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

"Production is truly the only place youcan validate your code."

~ Michael Nygard, about 40 min ago

Page 92: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

More database servers in prod.Bigger database hardware in prod.More web servers.Various replication schemes.Different versions of server and OS software.Schema changes applied at different times.Physical hardware in prod.More data in prod.Legacy data (7 years of odd user states).More traffic in prod.Wait, I mean MUCH more traffic in prod.Fewer elves.Faster disks (SSDs) in prod.

Page 93: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Using a MySQL database to test an application that will eventually be deployed on Oracle:

Page 94: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Using a MySQL database to test an application that will eventually be deployed on Oracle: Priceless.

Page 95: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Verify frequently and in small batches.

Page 96: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Dev ≠ Prod

Page 97: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Dev ⇾ QA ⇾ Staging ⇾ Prod

Page 98: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Dev ⇾ QA ⇾ Staging ⇾ Prod

Page 99: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Dev ⇾ Pre-Prod ⇾ Prod

Page 100: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Test and integrate where you’ll see value.

Page 101: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Config flags (again)

off, on, staff, opt-in prototypes, user list, 0-100%

Page 102: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Config flags (again)

off, on, staff, opt-in prototypes, user list, 0-100%

“canary pools”

Page 103: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Automated tests after deploy

Page 104: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Real-time metrics and dashboardsNetwork & Servers, Application, Business

Page 105: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve
Page 106: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Release Managers: 0

Page 107: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve
Page 108: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Is it Broken? Or , is it just better?

Page 109: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve
Page 110: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Metrics + Configs ⇾ OODA Loop

Page 111: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

“Theoretical” vs. “Practical”

Page 112: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Surprise!!!Turning off multi-language supportimproves our page generation times by up to 25%.

Homepage (95th perc.)

Page 113: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Nope. It’s really broken.

Page 114: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

http://www.flickr.com/photos/flyforfun/2694158656/

OperatorConfig flags

Metrics

Page 115: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Thursday, Nov 22 - ThanksgivingFriday, Nov 23 - “Black Friday”

Monday, Nov 26 - “Cyber Monday”

~30 days out from Christmas

Page 116: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

30

20

10

40

Page 117: CONTINUOUS DELIVERY: THE DIRTY DETAILSgotocon.com/dl/goto-aar-2012/slides/MikeBrittain... · Continuous delivery is a pattern language in growing use in software development to improve

Thank you.

Mike Brittain

[email protected]@mikebrittain