SlideShare une entreprise Scribd logo
1  sur  124
Télécharger pour lire hors ligne
Advanced Topics in
Continuous Deployment
Mike Brittain
Engineering Director, Etsy
@mikebrittain mikebrittain.com/talks
- Config flags - this one goes to eleven.
Today’s TOPICs
credit: photobookgirl (flickr)
- Config flags - this one goes to eleven.
- Automated deploys - never settle for anything less
Today’s TOPICs
credit: photobookgirl (flickr)
- Config flags - this one goes to eleven.
- Automated deploys - never settle for anything less
- Release management - who needs it?!?
Today’s TOPICs
credit: photobookgirl (flickr)
- Config flags - this one goes to eleven.
- Automated deploys - never settle for anything less
- Release management - who needs it?!?
- Deploying schema changes - ‘cause everybody asks
Today’s TOPICs
credit: photobookgirl (flickr)
www. .com
20 Million Items listed
60+ Million Monthly unique visitors
200 Countries with annual transactions
!
175+ Committers, everyone deploys
Items by anjaysdesigns, betwixxt, OneStarLeatherGoods, mediumcontrol, TheDesignPallet
Linux, Apache, MySQL, PHP
ArchitectureStack
Memcache, Gearman, Redis, node.js,
Postgresql, Solr, Java, Apache Traffic Server,
Hadoop, HBase
credit: Saire Elizabeth (flickr)
Git, Jenkins
Chef, Ruby, Python
@mikebrittain
DEPLOYMENTSPERDAY
APPCODE
CONFIGFILES
1st Day Assignment
Put your face on etsy.com/about
2nd day
Complete tax, insurance, and
benefits forms.
credit: ktpupp (flickr)
I’m not telling you to go do this.
(But you can go do this.)
credit: photobookgirl (flickr)
- Config flags - this one goes to eleven.
Today’s TOPICs
Code Deploy ≠ Feature Release
(Most deploys are gated by config flags)
$cfg[‘new_search’] = array('enabled' => 'off');
$cfg[‘sign_in’] = array('enabled' => 'on');
$cfg[‘checkout’] = array('enabled' => 'on');
$cfg[‘homepage’] = array('enabled' => 'on');
$cfg[‘new_search’] = array('enabled' => 'off');
!
$cfg[‘new_search’] = array('enabled' => 'off');
!
// Meanwhile...
!
!
!
!
!
# old and boring search
$results = do_grep();
$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();
}
$cfg[‘new_search’] = array('enabled' => 'on');
$cfg[‘new_search’] = array('enabled' => 'off');
“Config Flags,” “Feature Flags,” “Feature Toggles”
$cfg[‘new_search’] = array('enabled' => 'on');
$cfg[‘new_search’] = array('enabled' => 'off');
!
// or...
!
$cfg[‘new_search’] = array('enabled' => 'staff');
!
$cfg[‘new_search’] = array('enabled' => 'on');
$cfg[‘new_search’] = array('enabled' => 'off');
!
// or...
!
$cfg[‘new_search’] = array('enabled' => 'staff');
!
// or...
!
$cfg[‘new_search’] = array('enabled' => 'users',
'user_list' => 'mike,john,kellan');
etsy.com/prototypes
$cfg[‘new_search’] = array('enabled' => 'on');
$cfg[‘new_search’] = array('enabled' => 'off');
!
// or...
!
$cfg[‘new_search’] = array('enabled' => 'staff');
!
// or...
!
$cfg[‘new_search’] = array('enabled' => 'users',
'user_list' => 'mike,john,kellan');
// or...
!
$cfg[‘new_search’] = array('enabled' => '1%');
!
$cfg[‘new_search’] = array('enabled' => 'on');
$cfg[‘new_search’] = array('enabled' => 'off');
!
// or...
!
$cfg[‘new_search’] = array('enabled' => 'staff');
!
// or...
!
$cfg[‘new_search’] = array('enabled' => 'users',
'user_list' => 'mike,john,kellan');
// or...
!
$cfg[‘new_search’] = array('enabled' => '1%');
$cfg[‘new_search’] = array('enabled' => '5%');
!
$cfg[‘new_search’] = array('enabled' => 'on');
$cfg[‘new_search’] = array('enabled' => 'off');
!
// or...
!
$cfg[‘new_search’] = array('enabled' => 'staff');
!
// or...
!
$cfg[‘new_search’] = array('enabled' => 'users',
'user_list' => 'mike,john,kellan');
// or...
!
$cfg[‘new_search’] = array('enabled' => '1%');
$cfg[‘new_search’] = array('enabled' => '5%');
$cfg[‘new_search’] = array('enabled' => '11%');
“This one goes to eleven.”
$cfg[‘new_search’] = array('enabled' => 'on');
$cfg[‘new_search’] = array('enabled' => 'off');
!
// or...
!
$cfg[‘new_search’] = array('enabled' => 'staff');
!
// or...
!
$cfg[‘new_search’] = array('enabled' => 'users',
'user_list' => 'mike,john,kellan');
// or...
!
$cfg[‘new_search’] = array('enabled' => '1%');
$cfg[‘new_search’] = array('enabled' => '5%');
$cfg[‘new_search’] = array('enabled' => '11%');
https://github.com/etsy/feature
Validate in production, hidden from public.
Product managers still “release” features.
Small incremental changes to the application
New classes, methods, controllers
Graphics, stylesheets, templates
Copy/content changes
App deploys
Turning flags on, off, or % ramp up
Config deploys
http://www.flickr.com/photos/flyforfun/2694158656/
http://www.flickr.com/photos/flyforfun/2694158656/
Operator
Config flags
Metrics
Latent bugs and security holes
Traffic management, load shedding
Adding and removing infrastructure
!
Tweaking config flags or releasing patches.
“Operating” the site
Favorites
“on”
Favorites
“off”
Favorites
“on”
Promote “dev flags” to “feature flags”
// Feature flag
$cfg[‘mobilized_pages’] = array('enabled' => 'on');
!
// Dev flags
$cfg[‘mobile_templates_seller_tools’] = array('enabled' => 'on');
$cfg[‘mobile_templates_account_tools’] = array('enabled' => 'on');
$cfg[‘mobile_templates_member_profile’] = array('enabled' => 'on');
$cfg[‘mobile_templates_search’] = array('enabled' => 'off');
$cfg[‘mobile_templates_activity_feed’] = array('enabled' => 'off');
!
...
!
if ($cfg[‘mobilized_pages’] == ‘on’ && $cfg[‘mobile_templates_search’] == ‘on’) {
// ...
// ...
}
// Feature flags
$cfg[‘search’] = array('enabled' => 'on');
$cfg[‘developer_api’] = array('enabled' => 'on');
$cfg[‘seller_tools’] = array('enabled' => 'on');
!
$cfg[‘the_entire_web_site’] = array('enabled' => 'on');
// Feature flags
$cfg[‘search’] = array('enabled' => 'on');
$cfg[‘developer_api’] = array('enabled' => 'on');
$cfg[‘seller_tools’] = array('enabled' => 'on');
!
$cfg[‘the_entire_web_site’] = array('enabled' => 'on');
$cfg[‘the_entire_web_site_no_really_i_mean_it’] = array('enabled' => 'on');
Go add one config flag to your codebase.
credit: photobookgirl (flickr)
- Automated deploys - never settle for anything less
Today’s TOPICs
Interpreted language, text files.
Opcode cache (Opcache or APC)
~100 servers (web, gearman, api)
Rsync (push, not pull)
Avoid restarts
PHP & Apache
Lots of remote orchestration (ssh and dsh)
Push code from a git clone to production network.
Splay to a few boxes, each splays to more.
Stage files in a temp location on prod boxes.
Local rsync (using dsh) into live docroot.
Keeping things fast
100+ files opened per request.
Flushing opcode cache (or graceful restart).
Mostly harmless.
What can go wrong with this?
“Screwed Users”
Two document roots (“yin” and “yang”)
Symbolic link to the right one
Opcache has to use path name, not inode
Atomic deploys
http://codeascraft.com/2013/07/01/atomic-deploys-at-etsy/
Binaries, not text files
Requires restarts
Requires search index and cache warming
Rsync (push, not pull)
Solr and JVM
Take boxes out of rotation, deploy, bring back up
Beware capacity management
Multiple versions running for extended period
Rollbacks are a pain (esp. when in mixed-state)
Rolling restarts
“Fraught with danger.”
One live cluster, one dark cluster
Deploy to dark cluster (indexes, pre-warm, restarts)
Define search clusters in app config
Switch cluster traffic via config deploy
“Flip” and “Flop”
Start with a shell script.
Yours will be a unique snowflake.
credit: photobookgirl (flickr)
- Release management - who needs it?!?
Today’s TOPICs
We have a one-button deploy tool,
We manage deploys in an IRC channel.
#push
Thank you.
Mike Brittain
Engineering Director, Etsy
@mikebrittain mikebrittain.com/talks
We have a one-button deploy tool,
We manage deploys in an IRC channel.
I mean, seriously… what else do you want to know?!?
Keep real people in the loop
Queue, with max batch size of seven.
Automated deployment run by humans
Pssst… Want to see how it works?
4 people in this
deploy.
“I’ve pushed my changes to master.”
“Everyone has checked in.”
Build QA and
Pre-prod
Build
progress
Status in #push
Git SHA1 in for each env.
Date, username, deploy log, changeset, link to
dashboard from time of deploy
Reporting what’s going on in
Deployinator, and who triggered
Status from
build cluster
Pre-prod (“princess”) has been deployed.
!
SHA1 of the change
Time it took to deploy
Link to changeset in GitHub
Log of the deploy script
Btw, there are three bots talking in
channel at this point. O_o
Queuing for next deploy
Humans talk to
other humans
from time to time.
Talking to pushbot.
!
Pushbot knows some Spanish…
because, ya know, why not?
Link to test results for CI environment,
along with how long the tests took.Alerting by name.
8 minutes have elapsed…
We’ve built and tested our release in the
CI environment (“QA”).
!
QA build failed our 5 min. SLA for tests.
“Try” is our pre-commit testing cluster.
Bots help reinforce our values. This
is especially helpful for new people
on the team.
Still 8 minutes elapsed…
Pre-prod has been deployed and tested.
!
This ran in parallel with our QA build and tests.
Cross-traffic:
In a separate channel (#config), our app configs
files were deployed to pre-prod.
Cross-traffic:
Ops team deployed a configuration change.
Code is live
Link to dashboard.
13 minutes elapsed…
Code is now in production with public traffic.
Who committed code in the last deploy? And
how many lines did each of them change?
Handoff for the
next deploy.
Entire app deploy took 15 minutes.
!
4 people running the deployment
8 committers
Config deploy and Chef change deployed in parallel.
Optimal queue size
Normalized communication
Improved visibility
Historical record is ideal for post-mortems
Organic evolution
Hold up the queue (.hold)
Work the issue with the people available in #push
Additional help always available in #sysops
Buddy-system for off-hours deploys
Ops-on-call, dev-on-call
When something goes wrong?
You won’t need an IRC channel.
credit: photobookgirl (flickr)
- Deploying schema changes…. with code?
Today’s TOPICs
credit: photobookgirl (flickr)
- Deploying schema changes…. with code?
Today’s TOPICs
(a.k.a Don’t do this!)
~15-20 minutes
THURSDAYS!
Code deploys
Schema changes
credit: photobookgirl (flickr)
- Deploying schema changes
Today’s TOPICs
- Managing versions across services
Our web application is largely monolithic.
Etsy.com, Support & Back-office tools,
Developer API, Gearman (async work)
Etsy.com, Support & Back-office tools,
Developer API, Gearman (async work)
PHP, Apache, Memcache
Our web application is largely monolithic.
External “services” are not deployed with
the main application.
e.g. Databases, Search, Photo storage, Payments
e.g. Databases, Search, Photo storage, Payments
MYSQL
(schema changes)
SOLR, JVM
(rolling restarts)
PROXY CACHE,
FILERS, AMAZON S3
(specialized infra.)
PCI
(controlled access)
External “services” are not deployed with
the main application.
For every config flag, there are two states
we can support — present and future.
... or past and present.
For every config flag, there are two states
we can support — present and future.
$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();
}
“Non-Breaking Expansions”
Expose new version in a service interface;
support multiple versions in the consumer.
Example: Changing a Database Schema
Merging “users” and “users_prefs”
RULE OF THUMB
Prefer ADDs over ALTERs (non-breaking expansion)
C
!
1. Write to both versions
2. Backfill historical data
3. Read from new version
4. Cut-off writes to old version
0. Add new version to schema
1. Write to both versions
2. Backfill historical data
3. Read from new version
4. Cut-off writes to old version
0. Add new version to schema
Schema 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”
1. Write to both versions
Write 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”
2. Backfill historical data
Offline process to sync existing data from “user_prefs”
to new columns in “users”
3. Read from new version
Data validation tests. Ensure consistency both internally
and in production.
!
“write_prefs_to_user_prefs_table” => “on”
“write_prefs_to_users_table” => “on”
“read_prefs_from_users_table” => “staff”
!
3. Read from new version
Data validation tests. Ensure consistency both internally
and in production.
!
“write_prefs_to_user_prefs_table” => “on”
“write_prefs_to_users_table” => “on”
“read_prefs_from_users_table” => “1%”
!
3. Read from new version
Data validation tests. Ensure consistency both internally
and in production.
!
“write_prefs_to_user_prefs_table” => “on”
“write_prefs_to_users_table” => “on”
“read_prefs_from_users_table” => “5%”
!
3. Read from new version
Data validation tests. Ensure consistency both internally
and in production.
!
“write_prefs_to_user_prefs_table” => “on”
“write_prefs_to_users_table” => “on”
“read_prefs_from_users_table” => “11%”
!
“This one goes to eleven.”
3. Read from new version
Data validation tests. Ensure consistency both internally
and in production.
!
“write_prefs_to_user_prefs_table” => “on”
“write_prefs_to_users_table” => “on”
“read_prefs_from_users_table” => “on” // same as 100%
!
!
!
!
4. Cut-off writes to old version
After 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”
!
“Branch by Astraction”
Controller Controller
Users Model
“users” (old) “user_prefs” “users”
old schema new schema
(Abstraction)
http://paulhammant.com/blog/branch_by_abstraction.html	

http://continuousdelivery.com/2011/05/make-large-scale-changes-incrementally-with-branch-by-abstraction/
Avoid temptation of putting logic into DB
Async worker queue (Gearman)
Get good at alerting on data inconsistencies
Easier to scale out app servers that DBs
Shards limit complexity
About our database design…
No longer valid for the business
No longer stable, valid, or trusted code
Impacting performance or readability
We can afford to spend time
Clean up old config flags?
Decouple schema changes from app code.
Aim for simplicity.
Start small. (We did.)
Automated tests and production monitoring.
Have a story around maintaining quality.
“We can always go back to the old way.”
Demonstrate value to leadership.
Go write your own story.
Thank you.
Mike Brittain
Engineering Director, Etsy
@mikebrittain mikebrittain.com/talks

Contenu connexe

Tendances

vJUG - The JavaFX Ecosystem
vJUG - The JavaFX EcosystemvJUG - The JavaFX Ecosystem
vJUG - The JavaFX EcosystemAndres Almiray
 
Keeping your CI/CD pipeline as fast as it needs to be
Keeping your CI/CD pipeline as fast as it needs to beKeeping your CI/CD pipeline as fast as it needs to be
Keeping your CI/CD pipeline as fast as it needs to beAbraham Marin-Perez
 
JavaOne - The JavaFX Community and Ecosystem
JavaOne - The JavaFX Community and EcosystemJavaOne - The JavaFX Community and Ecosystem
JavaOne - The JavaFX Community and EcosystemAlexander Casall
 
Towards Continuous Deployment with Django
Towards Continuous Deployment with DjangoTowards Continuous Deployment with Django
Towards Continuous Deployment with DjangoRoger Barnes
 
Building Quality with Foundations of Mud
Building Quality with Foundations of MudBuilding Quality with Foundations of Mud
Building Quality with Foundations of Mudseleniumconf
 
Selenium Clinic Eurostar 2012 WebDriver Tutorial
Selenium Clinic Eurostar 2012 WebDriver TutorialSelenium Clinic Eurostar 2012 WebDriver Tutorial
Selenium Clinic Eurostar 2012 WebDriver TutorialAlan Richardson
 
Unleashing Docker with Pipelines in Bitbucket Cloud
Unleashing Docker with Pipelines in Bitbucket CloudUnleashing Docker with Pipelines in Bitbucket Cloud
Unleashing Docker with Pipelines in Bitbucket CloudAtlassian
 
Using Selenium to Improve a Teams Development Cycle
Using Selenium to Improve a Teams Development CycleUsing Selenium to Improve a Teams Development Cycle
Using Selenium to Improve a Teams Development Cycleseleniumconf
 
JavaLand - Integration Testing How-to
JavaLand - Integration Testing How-toJavaLand - Integration Testing How-to
JavaLand - Integration Testing How-toNicolas Fränkel
 
Riga Dev Day - Automated Android Continuous Integration
Riga Dev Day - Automated Android Continuous IntegrationRiga Dev Day - Automated Android Continuous Integration
Riga Dev Day - Automated Android Continuous IntegrationNicolas Fränkel
 
Immutable Infrastructure & Rethinking Configuration - Interop 2019
Immutable Infrastructure & Rethinking Configuration - Interop 2019Immutable Infrastructure & Rethinking Configuration - Interop 2019
Immutable Infrastructure & Rethinking Configuration - Interop 2019RackN
 
The Bash Dashboard (Or: How to Use Bash for Data Analysis)
The Bash Dashboard (Or: How to Use Bash for Data Analysis)The Bash Dashboard (Or: How to Use Bash for Data Analysis)
The Bash Dashboard (Or: How to Use Bash for Data Analysis)Bram Adams
 
Web accessibility developers by Bao AN - eXo SEA
Web accessibility developers by Bao AN - eXo SEAWeb accessibility developers by Bao AN - eXo SEA
Web accessibility developers by Bao AN - eXo SEAThuy_Dang
 
Code Reviews vs. Pull Requests
Code Reviews vs. Pull RequestsCode Reviews vs. Pull Requests
Code Reviews vs. Pull RequestsAtlassian
 
Selenide alternative in Python - Introducing Selene [SeleniumCamp 2016]
Selenide alternative in Python - Introducing Selene [SeleniumCamp 2016]Selenide alternative in Python - Introducing Selene [SeleniumCamp 2016]
Selenide alternative in Python - Introducing Selene [SeleniumCamp 2016]Iakiv Kramarenko
 
QA Fest 2018. Adam Stasiak. React Native is Coming – the story of hybrid mobi...
QA Fest 2018. Adam Stasiak. React Native is Coming – the story of hybrid mobi...QA Fest 2018. Adam Stasiak. React Native is Coming – the story of hybrid mobi...
QA Fest 2018. Adam Stasiak. React Native is Coming – the story of hybrid mobi...QAFest
 
Hosting Your Own OTA Update Service
Hosting Your Own OTA Update ServiceHosting Your Own OTA Update Service
Hosting Your Own OTA Update ServiceQuinlan Jung
 

Tendances (20)

Cache is King
Cache is KingCache is King
Cache is King
 
vJUG - The JavaFX Ecosystem
vJUG - The JavaFX EcosystemvJUG - The JavaFX Ecosystem
vJUG - The JavaFX Ecosystem
 
Keeping your CI/CD pipeline as fast as it needs to be
Keeping your CI/CD pipeline as fast as it needs to beKeeping your CI/CD pipeline as fast as it needs to be
Keeping your CI/CD pipeline as fast as it needs to be
 
The JavaFX Ecosystem
The JavaFX EcosystemThe JavaFX Ecosystem
The JavaFX Ecosystem
 
JavaOne - The JavaFX Community and Ecosystem
JavaOne - The JavaFX Community and EcosystemJavaOne - The JavaFX Community and Ecosystem
JavaOne - The JavaFX Community and Ecosystem
 
Towards Continuous Deployment with Django
Towards Continuous Deployment with DjangoTowards Continuous Deployment with Django
Towards Continuous Deployment with Django
 
Building Quality with Foundations of Mud
Building Quality with Foundations of MudBuilding Quality with Foundations of Mud
Building Quality with Foundations of Mud
 
Selenium Clinic Eurostar 2012 WebDriver Tutorial
Selenium Clinic Eurostar 2012 WebDriver TutorialSelenium Clinic Eurostar 2012 WebDriver Tutorial
Selenium Clinic Eurostar 2012 WebDriver Tutorial
 
Your code are my tests
Your code are my testsYour code are my tests
Your code are my tests
 
Unleashing Docker with Pipelines in Bitbucket Cloud
Unleashing Docker with Pipelines in Bitbucket CloudUnleashing Docker with Pipelines in Bitbucket Cloud
Unleashing Docker with Pipelines in Bitbucket Cloud
 
Using Selenium to Improve a Teams Development Cycle
Using Selenium to Improve a Teams Development CycleUsing Selenium to Improve a Teams Development Cycle
Using Selenium to Improve a Teams Development Cycle
 
JavaLand - Integration Testing How-to
JavaLand - Integration Testing How-toJavaLand - Integration Testing How-to
JavaLand - Integration Testing How-to
 
Riga Dev Day - Automated Android Continuous Integration
Riga Dev Day - Automated Android Continuous IntegrationRiga Dev Day - Automated Android Continuous Integration
Riga Dev Day - Automated Android Continuous Integration
 
Immutable Infrastructure & Rethinking Configuration - Interop 2019
Immutable Infrastructure & Rethinking Configuration - Interop 2019Immutable Infrastructure & Rethinking Configuration - Interop 2019
Immutable Infrastructure & Rethinking Configuration - Interop 2019
 
The Bash Dashboard (Or: How to Use Bash for Data Analysis)
The Bash Dashboard (Or: How to Use Bash for Data Analysis)The Bash Dashboard (Or: How to Use Bash for Data Analysis)
The Bash Dashboard (Or: How to Use Bash for Data Analysis)
 
Web accessibility developers by Bao AN - eXo SEA
Web accessibility developers by Bao AN - eXo SEAWeb accessibility developers by Bao AN - eXo SEA
Web accessibility developers by Bao AN - eXo SEA
 
Code Reviews vs. Pull Requests
Code Reviews vs. Pull RequestsCode Reviews vs. Pull Requests
Code Reviews vs. Pull Requests
 
Selenide alternative in Python - Introducing Selene [SeleniumCamp 2016]
Selenide alternative in Python - Introducing Selene [SeleniumCamp 2016]Selenide alternative in Python - Introducing Selene [SeleniumCamp 2016]
Selenide alternative in Python - Introducing Selene [SeleniumCamp 2016]
 
QA Fest 2018. Adam Stasiak. React Native is Coming – the story of hybrid mobi...
QA Fest 2018. Adam Stasiak. React Native is Coming – the story of hybrid mobi...QA Fest 2018. Adam Stasiak. React Native is Coming – the story of hybrid mobi...
QA Fest 2018. Adam Stasiak. React Native is Coming – the story of hybrid mobi...
 
Hosting Your Own OTA Update Service
Hosting Your Own OTA Update ServiceHosting Your Own OTA Update Service
Hosting Your Own OTA Update Service
 

En vedette

From Building a Marketplace to Building Teams
From Building a Marketplace to Building TeamsFrom Building a Marketplace to Building Teams
From Building a Marketplace to Building TeamsMike Brittain
 
Distributed Release Management
Distributed Release ManagementDistributed Release Management
Distributed Release ManagementMike Brittain
 
How to Get to Second Base with Your CDN
How to Get to Second Base with Your CDNHow to Get to Second Base with Your CDN
How to Get to Second Base with Your CDNMike Brittain
 
Continuous Deployment: The Dirty Details
Continuous Deployment: The Dirty DetailsContinuous Deployment: The Dirty Details
Continuous Deployment: The Dirty DetailsMike Brittain
 
Simple Log Analysis and Trending
Simple Log Analysis and TrendingSimple Log Analysis and Trending
Simple Log Analysis and TrendingMike Brittain
 
On Failure and Resilience
On Failure and ResilienceOn Failure and Resilience
On Failure and ResilienceMike Brittain
 
Continuous Delivery: The Dirty Details
Continuous Delivery: The Dirty DetailsContinuous Delivery: The Dirty Details
Continuous Delivery: The Dirty DetailsMike Brittain
 
The Real Life Social Network v2
The Real Life Social Network v2The Real Life Social Network v2
The Real Life Social Network v2Paul Adams
 
Principles and Practices in Continuous Deployment at Etsy
Principles and Practices in Continuous Deployment at EtsyPrinciples and Practices in Continuous Deployment at Etsy
Principles and Practices in Continuous Deployment at EtsyMike Brittain
 
26 Disruptive & Technology Trends 2016 - 2018
26 Disruptive & Technology Trends 2016 - 201826 Disruptive & Technology Trends 2016 - 2018
26 Disruptive & Technology Trends 2016 - 2018Brian Solis
 

En vedette (10)

From Building a Marketplace to Building Teams
From Building a Marketplace to Building TeamsFrom Building a Marketplace to Building Teams
From Building a Marketplace to Building Teams
 
Distributed Release Management
Distributed Release ManagementDistributed Release Management
Distributed Release Management
 
How to Get to Second Base with Your CDN
How to Get to Second Base with Your CDNHow to Get to Second Base with Your CDN
How to Get to Second Base with Your CDN
 
Continuous Deployment: The Dirty Details
Continuous Deployment: The Dirty DetailsContinuous Deployment: The Dirty Details
Continuous Deployment: The Dirty Details
 
Simple Log Analysis and Trending
Simple Log Analysis and TrendingSimple Log Analysis and Trending
Simple Log Analysis and Trending
 
On Failure and Resilience
On Failure and ResilienceOn Failure and Resilience
On Failure and Resilience
 
Continuous Delivery: The Dirty Details
Continuous Delivery: The Dirty DetailsContinuous Delivery: The Dirty Details
Continuous Delivery: The Dirty Details
 
The Real Life Social Network v2
The Real Life Social Network v2The Real Life Social Network v2
The Real Life Social Network v2
 
Principles and Practices in Continuous Deployment at Etsy
Principles and Practices in Continuous Deployment at EtsyPrinciples and Practices in Continuous Deployment at Etsy
Principles and Practices in Continuous Deployment at Etsy
 
26 Disruptive & Technology Trends 2016 - 2018
26 Disruptive & Technology Trends 2016 - 201826 Disruptive & Technology Trends 2016 - 2018
26 Disruptive & Technology Trends 2016 - 2018
 

Similaire à Advanced Topics in Continuous Deployment

Workflow automation for Front-end web applications
Workflow automation for Front-end web applicationsWorkflow automation for Front-end web applications
Workflow automation for Front-end web applicationsMayank Patel
 
SpringOne Platform recap 정윤진
SpringOne Platform recap 정윤진SpringOne Platform recap 정윤진
SpringOne Platform recap 정윤진VMware Tanzu Korea
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...Fabio Franzini
 
Amplify your stack - Jsfoo pune 2012
Amplify your stack - Jsfoo pune 2012Amplify your stack - Jsfoo pune 2012
Amplify your stack - Jsfoo pune 2012threepointone
 
Art & music vs Google App Engine
Art & music vs Google App EngineArt & music vs Google App Engine
Art & music vs Google App Enginethomas alisi
 
Jarv.us Showcase — SenchaCon 2011
Jarv.us Showcase — SenchaCon 2011Jarv.us Showcase — SenchaCon 2011
Jarv.us Showcase — SenchaCon 2011Chris Alfano
 
Best Practices in Plugin Development (WordCamp Seattle)
Best Practices in Plugin Development (WordCamp Seattle)Best Practices in Plugin Development (WordCamp Seattle)
Best Practices in Plugin Development (WordCamp Seattle)andrewnacin
 
Release management with NuGet/Chocolatey/JIRA
Release management with NuGet/Chocolatey/JIRARelease management with NuGet/Chocolatey/JIRA
Release management with NuGet/Chocolatey/JIRAYaroslav Serhieiev
 
Puppet for Sys Admins
Puppet for Sys AdminsPuppet for Sys Admins
Puppet for Sys AdminsPuppet
 
Socket applications
Socket applicationsSocket applications
Socket applicationsJoão Moura
 
(BDT402) Performance Profiling in Production: Analyzing Web Requests at Scale...
(BDT402) Performance Profiling in Production: Analyzing Web Requests at Scale...(BDT402) Performance Profiling in Production: Analyzing Web Requests at Scale...
(BDT402) Performance Profiling in Production: Analyzing Web Requests at Scale...Amazon Web Services
 
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)Doris Chen
 
jQuery in the [Aol.] Enterprise
jQuery in the [Aol.] EnterprisejQuery in the [Aol.] Enterprise
jQuery in the [Aol.] EnterpriseDave Artz
 
Freeing the cloud, one service at a time
Freeing the cloud, one service at a timeFreeing the cloud, one service at a time
Freeing the cloud, one service at a timeFrancois Marier
 
Pyramid Lighter/Faster/Better web apps
Pyramid Lighter/Faster/Better web appsPyramid Lighter/Faster/Better web apps
Pyramid Lighter/Faster/Better web appsDylan Jay
 

Similaire à Advanced Topics in Continuous Deployment (20)

Workflow automation for Front-end web applications
Workflow automation for Front-end web applicationsWorkflow automation for Front-end web applications
Workflow automation for Front-end web applications
 
SpringOne Platform recap 정윤진
SpringOne Platform recap 정윤진SpringOne Platform recap 정윤진
SpringOne Platform recap 정윤진
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...
 
Amplify your stack - Jsfoo pune 2012
Amplify your stack - Jsfoo pune 2012Amplify your stack - Jsfoo pune 2012
Amplify your stack - Jsfoo pune 2012
 
Deployment talk dpc 13
Deployment talk dpc 13Deployment talk dpc 13
Deployment talk dpc 13
 
Art & music vs Google App Engine
Art & music vs Google App EngineArt & music vs Google App Engine
Art & music vs Google App Engine
 
Jarv.us Showcase — SenchaCon 2011
Jarv.us Showcase — SenchaCon 2011Jarv.us Showcase — SenchaCon 2011
Jarv.us Showcase — SenchaCon 2011
 
Seven deadly theming sins
Seven deadly theming sinsSeven deadly theming sins
Seven deadly theming sins
 
Best Practices in Plugin Development (WordCamp Seattle)
Best Practices in Plugin Development (WordCamp Seattle)Best Practices in Plugin Development (WordCamp Seattle)
Best Practices in Plugin Development (WordCamp Seattle)
 
Release management with NuGet/Chocolatey/JIRA
Release management with NuGet/Chocolatey/JIRARelease management with NuGet/Chocolatey/JIRA
Release management with NuGet/Chocolatey/JIRA
 
Puppet for Sys Admins
Puppet for Sys AdminsPuppet for Sys Admins
Puppet for Sys Admins
 
Socket applications
Socket applicationsSocket applications
Socket applications
 
(BDT402) Performance Profiling in Production: Analyzing Web Requests at Scale...
(BDT402) Performance Profiling in Production: Analyzing Web Requests at Scale...(BDT402) Performance Profiling in Production: Analyzing Web Requests at Scale...
(BDT402) Performance Profiling in Production: Analyzing Web Requests at Scale...
 
Django tricks (2)
Django tricks (2)Django tricks (2)
Django tricks (2)
 
Django at Scale
Django at ScaleDjango at Scale
Django at Scale
 
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
 
jQuery in the [Aol.] Enterprise
jQuery in the [Aol.] EnterprisejQuery in the [Aol.] Enterprise
jQuery in the [Aol.] Enterprise
 
Freeing the cloud, one service at a time
Freeing the cloud, one service at a timeFreeing the cloud, one service at a time
Freeing the cloud, one service at a time
 
JS Essence
JS EssenceJS Essence
JS Essence
 
Pyramid Lighter/Faster/Better web apps
Pyramid Lighter/Faster/Better web appsPyramid Lighter/Faster/Better web apps
Pyramid Lighter/Faster/Better web apps
 

Dernier

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 

Dernier (20)

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 

Advanced Topics in Continuous Deployment

  • 1. Advanced Topics in Continuous Deployment Mike Brittain Engineering Director, Etsy @mikebrittain mikebrittain.com/talks
  • 2. - Config flags - this one goes to eleven. Today’s TOPICs credit: photobookgirl (flickr)
  • 3. - Config flags - this one goes to eleven. - Automated deploys - never settle for anything less Today’s TOPICs credit: photobookgirl (flickr)
  • 4. - Config flags - this one goes to eleven. - Automated deploys - never settle for anything less - Release management - who needs it?!? Today’s TOPICs credit: photobookgirl (flickr)
  • 5. - Config flags - this one goes to eleven. - Automated deploys - never settle for anything less - Release management - who needs it?!? - Deploying schema changes - ‘cause everybody asks Today’s TOPICs credit: photobookgirl (flickr)
  • 7. 20 Million Items listed 60+ Million Monthly unique visitors 200 Countries with annual transactions ! 175+ Committers, everyone deploys Items by anjaysdesigns, betwixxt, OneStarLeatherGoods, mediumcontrol, TheDesignPallet
  • 8. Linux, Apache, MySQL, PHP ArchitectureStack Memcache, Gearman, Redis, node.js, Postgresql, Solr, Java, Apache Traffic Server, Hadoop, HBase credit: Saire Elizabeth (flickr) Git, Jenkins Chef, Ruby, Python
  • 10. 1st Day Assignment Put your face on etsy.com/about
  • 11. 2nd day Complete tax, insurance, and benefits forms. credit: ktpupp (flickr)
  • 12. I’m not telling you to go do this. (But you can go do this.)
  • 13. credit: photobookgirl (flickr) - Config flags - this one goes to eleven. Today’s TOPICs
  • 14. Code Deploy ≠ Feature Release (Most deploys are gated by config flags)
  • 15. $cfg[‘new_search’] = array('enabled' => 'off'); $cfg[‘sign_in’] = array('enabled' => 'on'); $cfg[‘checkout’] = array('enabled' => 'on'); $cfg[‘homepage’] = array('enabled' => 'on');
  • 17. $cfg[‘new_search’] = array('enabled' => 'off'); ! // Meanwhile... ! ! ! ! ! # old and boring search $results = do_grep();
  • 18. $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(); }
  • 19. $cfg[‘new_search’] = array('enabled' => 'on'); $cfg[‘new_search’] = array('enabled' => 'off'); “Config Flags,” “Feature Flags,” “Feature Toggles”
  • 20. $cfg[‘new_search’] = array('enabled' => 'on'); $cfg[‘new_search’] = array('enabled' => 'off'); ! // or... ! $cfg[‘new_search’] = array('enabled' => 'staff'); !
  • 21. $cfg[‘new_search’] = array('enabled' => 'on'); $cfg[‘new_search’] = array('enabled' => 'off'); ! // or... ! $cfg[‘new_search’] = array('enabled' => 'staff'); ! // or... ! $cfg[‘new_search’] = array('enabled' => 'users', 'user_list' => 'mike,john,kellan'); etsy.com/prototypes
  • 22. $cfg[‘new_search’] = array('enabled' => 'on'); $cfg[‘new_search’] = array('enabled' => 'off'); ! // or... ! $cfg[‘new_search’] = array('enabled' => 'staff'); ! // or... ! $cfg[‘new_search’] = array('enabled' => 'users', 'user_list' => 'mike,john,kellan'); // or... ! $cfg[‘new_search’] = array('enabled' => '1%'); !
  • 23. $cfg[‘new_search’] = array('enabled' => 'on'); $cfg[‘new_search’] = array('enabled' => 'off'); ! // or... ! $cfg[‘new_search’] = array('enabled' => 'staff'); ! // or... ! $cfg[‘new_search’] = array('enabled' => 'users', 'user_list' => 'mike,john,kellan'); // or... ! $cfg[‘new_search’] = array('enabled' => '1%'); $cfg[‘new_search’] = array('enabled' => '5%'); !
  • 24. $cfg[‘new_search’] = array('enabled' => 'on'); $cfg[‘new_search’] = array('enabled' => 'off'); ! // or... ! $cfg[‘new_search’] = array('enabled' => 'staff'); ! // or... ! $cfg[‘new_search’] = array('enabled' => 'users', 'user_list' => 'mike,john,kellan'); // or... ! $cfg[‘new_search’] = array('enabled' => '1%'); $cfg[‘new_search’] = array('enabled' => '5%'); $cfg[‘new_search’] = array('enabled' => '11%'); “This one goes to eleven.”
  • 25. $cfg[‘new_search’] = array('enabled' => 'on'); $cfg[‘new_search’] = array('enabled' => 'off'); ! // or... ! $cfg[‘new_search’] = array('enabled' => 'staff'); ! // or... ! $cfg[‘new_search’] = array('enabled' => 'users', 'user_list' => 'mike,john,kellan'); // or... ! $cfg[‘new_search’] = array('enabled' => '1%'); $cfg[‘new_search’] = array('enabled' => '5%'); $cfg[‘new_search’] = array('enabled' => '11%'); https://github.com/etsy/feature
  • 26. Validate in production, hidden from public. Product managers still “release” features.
  • 27. Small incremental changes to the application New classes, methods, controllers Graphics, stylesheets, templates Copy/content changes App deploys Turning flags on, off, or % ramp up Config deploys
  • 30. Latent bugs and security holes Traffic management, load shedding Adding and removing infrastructure ! Tweaking config flags or releasing patches. “Operating” the site
  • 34. Promote “dev flags” to “feature flags”
  • 35. // Feature flag $cfg[‘mobilized_pages’] = array('enabled' => 'on'); ! // Dev flags $cfg[‘mobile_templates_seller_tools’] = array('enabled' => 'on'); $cfg[‘mobile_templates_account_tools’] = array('enabled' => 'on'); $cfg[‘mobile_templates_member_profile’] = array('enabled' => 'on'); $cfg[‘mobile_templates_search’] = array('enabled' => 'off'); $cfg[‘mobile_templates_activity_feed’] = array('enabled' => 'off'); ! ... ! if ($cfg[‘mobilized_pages’] == ‘on’ && $cfg[‘mobile_templates_search’] == ‘on’) { // ... // ... }
  • 36. // Feature flags $cfg[‘search’] = array('enabled' => 'on'); $cfg[‘developer_api’] = array('enabled' => 'on'); $cfg[‘seller_tools’] = array('enabled' => 'on'); ! $cfg[‘the_entire_web_site’] = array('enabled' => 'on');
  • 37.
  • 38. // Feature flags $cfg[‘search’] = array('enabled' => 'on'); $cfg[‘developer_api’] = array('enabled' => 'on'); $cfg[‘seller_tools’] = array('enabled' => 'on'); ! $cfg[‘the_entire_web_site’] = array('enabled' => 'on'); $cfg[‘the_entire_web_site_no_really_i_mean_it’] = array('enabled' => 'on');
  • 39. Go add one config flag to your codebase.
  • 40. credit: photobookgirl (flickr) - Automated deploys - never settle for anything less Today’s TOPICs
  • 41. Interpreted language, text files. Opcode cache (Opcache or APC) ~100 servers (web, gearman, api) Rsync (push, not pull) Avoid restarts PHP & Apache
  • 42. Lots of remote orchestration (ssh and dsh) Push code from a git clone to production network. Splay to a few boxes, each splays to more. Stage files in a temp location on prod boxes. Local rsync (using dsh) into live docroot. Keeping things fast
  • 43. 100+ files opened per request. Flushing opcode cache (or graceful restart). Mostly harmless. What can go wrong with this?
  • 45. Two document roots (“yin” and “yang”) Symbolic link to the right one Opcache has to use path name, not inode Atomic deploys http://codeascraft.com/2013/07/01/atomic-deploys-at-etsy/
  • 46. Binaries, not text files Requires restarts Requires search index and cache warming Rsync (push, not pull) Solr and JVM
  • 47. Take boxes out of rotation, deploy, bring back up Beware capacity management Multiple versions running for extended period Rollbacks are a pain (esp. when in mixed-state) Rolling restarts
  • 49. One live cluster, one dark cluster Deploy to dark cluster (indexes, pre-warm, restarts) Define search clusters in app config Switch cluster traffic via config deploy “Flip” and “Flop”
  • 50. Start with a shell script. Yours will be a unique snowflake.
  • 51. credit: photobookgirl (flickr) - Release management - who needs it?!? Today’s TOPICs
  • 52. We have a one-button deploy tool, We manage deploys in an IRC channel.
  • 53.
  • 54. #push
  • 55. Thank you. Mike Brittain Engineering Director, Etsy @mikebrittain mikebrittain.com/talks
  • 56. We have a one-button deploy tool, We manage deploys in an IRC channel. I mean, seriously… what else do you want to know?!?
  • 57. Keep real people in the loop Queue, with max batch size of seven. Automated deployment run by humans
  • 58. Pssst… Want to see how it works?
  • 59. 4 people in this deploy. “I’ve pushed my changes to master.” “Everyone has checked in.”
  • 60. Build QA and Pre-prod Build progress Status in #push Git SHA1 in for each env. Date, username, deploy log, changeset, link to dashboard from time of deploy
  • 61.
  • 62. Reporting what’s going on in Deployinator, and who triggered Status from build cluster
  • 63. Pre-prod (“princess”) has been deployed. ! SHA1 of the change Time it took to deploy Link to changeset in GitHub Log of the deploy script
  • 64. Btw, there are three bots talking in channel at this point. O_o
  • 65. Queuing for next deploy Humans talk to other humans from time to time.
  • 66. Talking to pushbot. ! Pushbot knows some Spanish… because, ya know, why not?
  • 67.
  • 68. Link to test results for CI environment, along with how long the tests took.Alerting by name.
  • 69. 8 minutes have elapsed… We’ve built and tested our release in the CI environment (“QA”). ! QA build failed our 5 min. SLA for tests.
  • 70. “Try” is our pre-commit testing cluster.
  • 71. Bots help reinforce our values. This is especially helpful for new people on the team.
  • 72.
  • 73. Still 8 minutes elapsed… Pre-prod has been deployed and tested. ! This ran in parallel with our QA build and tests.
  • 74.
  • 75. Cross-traffic: In a separate channel (#config), our app configs files were deployed to pre-prod.
  • 76.
  • 77.
  • 78.
  • 79.
  • 80. Cross-traffic: Ops team deployed a configuration change.
  • 81.
  • 82. Code is live Link to dashboard.
  • 83.
  • 84. 13 minutes elapsed… Code is now in production with public traffic.
  • 85. Who committed code in the last deploy? And how many lines did each of them change?
  • 86.
  • 87.
  • 89. Entire app deploy took 15 minutes. ! 4 people running the deployment 8 committers Config deploy and Chef change deployed in parallel.
  • 90. Optimal queue size Normalized communication Improved visibility Historical record is ideal for post-mortems Organic evolution
  • 91. Hold up the queue (.hold) Work the issue with the people available in #push Additional help always available in #sysops Buddy-system for off-hours deploys Ops-on-call, dev-on-call When something goes wrong?
  • 92. You won’t need an IRC channel.
  • 93. credit: photobookgirl (flickr) - Deploying schema changes…. with code? Today’s TOPICs
  • 94. credit: photobookgirl (flickr) - Deploying schema changes…. with code? Today’s TOPICs (a.k.a Don’t do this!)
  • 96. credit: photobookgirl (flickr) - Deploying schema changes Today’s TOPICs - Managing versions across services
  • 97. Our web application is largely monolithic. Etsy.com, Support & Back-office tools, Developer API, Gearman (async work)
  • 98. Etsy.com, Support & Back-office tools, Developer API, Gearman (async work) PHP, Apache, Memcache Our web application is largely monolithic.
  • 99. External “services” are not deployed with the main application. e.g. Databases, Search, Photo storage, Payments
  • 100. e.g. Databases, Search, Photo storage, Payments MYSQL (schema changes) SOLR, JVM (rolling restarts) PROXY CACHE, FILERS, AMAZON S3 (specialized infra.) PCI (controlled access) External “services” are not deployed with the main application.
  • 101. For every config flag, there are two states we can support — present and future.
  • 102. ... or past and present. For every config flag, there are two states we can support — present and future.
  • 103. $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(); }
  • 104. “Non-Breaking Expansions” Expose new version in a service interface; support multiple versions in the consumer.
  • 105. Example: Changing a Database Schema Merging “users” and “users_prefs”
  • 106. RULE OF THUMB Prefer ADDs over ALTERs (non-breaking expansion) C
  • 107. ! 1. Write to both versions 2. Backfill historical data 3. Read from new version 4. Cut-off writes to old version
  • 108. 0. Add new version to schema 1. Write to both versions 2. Backfill historical data 3. Read from new version 4. Cut-off writes to old version
  • 109. 0. Add new version to schema Schema 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”
  • 110. 1. Write to both versions Write 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”
  • 111. 2. Backfill historical data Offline process to sync existing data from “user_prefs” to new columns in “users”
  • 112. 3. Read from new version Data validation tests. Ensure consistency both internally and in production. ! “write_prefs_to_user_prefs_table” => “on” “write_prefs_to_users_table” => “on” “read_prefs_from_users_table” => “staff” !
  • 113. 3. Read from new version Data validation tests. Ensure consistency both internally and in production. ! “write_prefs_to_user_prefs_table” => “on” “write_prefs_to_users_table” => “on” “read_prefs_from_users_table” => “1%” !
  • 114. 3. Read from new version Data validation tests. Ensure consistency both internally and in production. ! “write_prefs_to_user_prefs_table” => “on” “write_prefs_to_users_table” => “on” “read_prefs_from_users_table” => “5%” !
  • 115. 3. Read from new version Data validation tests. Ensure consistency both internally and in production. ! “write_prefs_to_user_prefs_table” => “on” “write_prefs_to_users_table” => “on” “read_prefs_from_users_table” => “11%” ! “This one goes to eleven.”
  • 116. 3. Read from new version Data validation tests. Ensure consistency both internally and in production. ! “write_prefs_to_user_prefs_table” => “on” “write_prefs_to_users_table” => “on” “read_prefs_from_users_table” => “on” // same as 100% ! ! ! !
  • 117. 4. Cut-off writes to old version After 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” !
  • 118. “Branch by Astraction” Controller Controller Users Model “users” (old) “user_prefs” “users” old schema new schema (Abstraction) http://paulhammant.com/blog/branch_by_abstraction.html http://continuousdelivery.com/2011/05/make-large-scale-changes-incrementally-with-branch-by-abstraction/
  • 119. Avoid temptation of putting logic into DB Async worker queue (Gearman) Get good at alerting on data inconsistencies Easier to scale out app servers that DBs Shards limit complexity About our database design…
  • 120. No longer valid for the business No longer stable, valid, or trusted code Impacting performance or readability We can afford to spend time Clean up old config flags?
  • 121. Decouple schema changes from app code. Aim for simplicity.
  • 122. Start small. (We did.) Automated tests and production monitoring. Have a story around maintaining quality. “We can always go back to the old way.” Demonstrate value to leadership.
  • 123. Go write your own story.
  • 124. Thank you. Mike Brittain Engineering Director, Etsy @mikebrittain mikebrittain.com/talks