Migrating to Microservices
Adrian Cockcroft @adrianco
Technology Fellow - Battery Ventures
GOTO Berlin - November 2014
Typical reactions to my Netflix talks…
Typical reactions to my Netflix talks…
“You guys are
crazy! Can’t
believe it”
– 2009
Typical reactions to my Netflix talks…
“You guys are
crazy! Can’t
believe it”
– 2009
“What Netflix is doing
won’t work”
– 2010
Typical reactions to my Netflix talks…
“You guys are
crazy! Can’t
believe it”
– 2009
“What Netflix is doing
won’t work”
– 2010
It only works for
‘Unicorns’ like
Netflix”
– 2011
Typical reactions to my Netflix talks…
“You guys are
crazy! Can’t
believe it”
– 2009
“What Netflix is doing
won’t work”
– 2010
It only works for
‘Unicorns’ like
Netflix”
– 2011
“We’d like to do 

that but can’t”
– 2012
Typical reactions to my Netflix talks…
“You guys are
crazy! Can’t
believe it”
– 2009
“What Netflix is doing
won’t work”
– 2010
It only works for
‘Unicorns’ like
Netflix”
– 2011
“We’d like to do 

that but can’t”
– 2012
“We’re on our way using
Netflix OSS code”
– 2013
What I learned from my time at Netflix
What I learned from my time at Netflix
•Speed wins in the marketplace
What I learned from my time at Netflix
•Speed wins in the marketplace
•Remove friction from product development
What I learned from my time at Netflix
•Speed wins in the marketplace
•Remove friction from product development
•High trust, low process, no hand-offs between teams
What I learned from my time at Netflix
•Speed wins in the marketplace
•Remove friction from product development
•High trust, low process, no hand-offs between teams
•Freedom and responsibility culture
What I learned from my time at Netflix
•Speed wins in the marketplace
•Remove friction from product development
•High trust, low process, no hand-offs between teams
•Freedom and responsibility culture
•Don’t do your own undifferentiated heavy lifting
What I learned from my time at Netflix
•Speed wins in the marketplace
•Remove friction from product development
•High trust, low process, no hand-offs between teams
•Freedom and responsibility culture
•Don’t do your own undifferentiated heavy lifting
•Use simple patterns automated by tooling
What I learned from my time at Netflix
•Speed wins in the marketplace
•Remove friction from product development
•High trust, low process, no hand-offs between teams
•Freedom and responsibility culture
•Don’t do your own undifferentiated heavy lifting
•Use simple patterns automated by tooling
•Self service cloud makes impossible things instant
Cloud Adoption
%*&!”
By Simon Wardley http://enterpriseitadoption.com/
Cloud Adoption
%*&!”
By Simon Wardley http://enterpriseitadoption.com/
2009
Cloud Adoption
%*&!”
By Simon Wardley http://enterpriseitadoption.com/
2009
Cloud Adoption
@adrianco’s
new job at the
intersection
of cloud and
Enterprise IT
%*&!”
By Simon Wardley http://enterpriseitadoption.com/
20142009
This is the year that Enterprises
finally embraced cloud.
This is the year that Enterprises
finally embraced cloud.
This is the year that Enterprises
finally embraced cloud.
This is the year that Enterprises
finally embraced cloud.
What separates
incumbents from
disruptors?
“It isn't what we don't know that
gives us trouble, it's what we
know that ain't so.”
!
Will Rogers
Assumptions
Optimizations
Assumption:
Process prevents
problems
Organizations build up
slow complex “Scar
tissue” processes
"This is the IT swamp draining manual for anyone who is
neck deep in alligators.”
1984 2014
Product
Development
Processes
Observe
Orient
Decide
Act Continuous
Delivery
Observe
Orient
Decide
Act
Land grab
opportunity Competitive
Move
Customer Pain
Point
Measure
Customers
Continuous
Delivery
Observe
Orient
Decide
Act
Land grab
opportunity Competitive
Move
Customer Pain
Point
INNOVATION
Measure
Customers
Continuous
Delivery
Observe
Orient
Decide
Act
Land grab
opportunity Competitive
Move
Customer Pain
Point
Analysis
Model
Hypotheses
INNOVATION
Measure
Customers
Continuous
Delivery
Observe
Orient
Decide
Act
Land grab
opportunity Competitive
Move
Customer Pain
Point
Analysis
Model
Hypotheses
BIG DATA
INNOVATION
Measure
Customers
Continuous
Delivery
Observe
Orient
Decide
Act
Land grab
opportunity Competitive
Move
Customer Pain
Point
Analysis
JFDI
Plan Response
Share Plans
Model
Hypotheses
BIG DATA
INNOVATION
Measure
Customers
Continuous
Delivery
Observe
Orient
Decide
Act
Land grab
opportunity Competitive
Move
Customer Pain
Point
Analysis
JFDI
Plan Response
Share Plans
Model
Hypotheses
BIG DATA
INNOVATION
CULTURE
Measure
Customers
Continuous
Delivery
Observe
Orient
Decide
Act
Land grab
opportunity Competitive
Move
Customer Pain
Point
Analysis
JFDI
Plan Response
Share Plans
Incremental
Features
Automatic
Deploy
Launch AB
Test
Model
Hypotheses
BIG DATA
INNOVATION
CULTURE
Measure
Customers
Continuous
Delivery
Observe
Orient
Decide
Act
Land grab
opportunity Competitive
Move
Customer Pain
Point
Analysis
JFDI
Plan Response
Share Plans
Incremental
Features
Automatic
Deploy
Launch AB
Test
Model
Hypotheses
BIG DATA
INNOVATION
CULTURE
CLOUD
Measure
Customers
Continuous
Delivery
Observe
Orient
Decide
Act
Land grab
opportunity Competitive
Move
Customer Pain
Point
Analysis
JFDI
Plan Response
Share Plans
Incremental
Features
Automatic
Deploy
Launch AB
Test
Model
Hypotheses
BIG DATA
INNOVATION
CULTURE
CLOUD
Measure
Customers
Continuous
Delivery
Observe
Orient
Decide
Act
Land grab
opportunity Competitive
Move
Customer Pain
Point
Analysis
JFDI
Plan Response
Share Plans
Incremental
Features
Automatic
Deploy
Launch AB
Test
Model
Hypotheses
BIG DATA
INNOVATION
CULTURE
CLOUD
Measure
Customers
Continuous
Delivery
Breaking Down the SILOs
Breaking Down the SILOs
QA DBA
Sys
Adm
Net
Adm
SAN
Adm
DevUX
Prod
Mgr
Breaking Down the SILOs
QA DBA
Sys
Adm
Net
Adm
SAN
Adm
DevUX
Prod
Mgr
Product Team Using Monolithic Delivery
Product Team Using Monolithic Delivery
Breaking Down the SILOs
QA DBA
Sys
Adm
Net
Adm
SAN
Adm
DevUX
Prod
Mgr
Product Team Using Microservices
Product Team Using Monolithic Delivery
Product Team Using Microservices
Product Team Using Microservices
Product Team Using Monolithic Delivery
Breaking Down the SILOs
QA DBA
Sys
Adm
Net
Adm
SAN
Adm
DevUX
Prod
Mgr
Product Team Using Microservices
Product Team Using Monolithic Delivery
Platform TeamProduct Team Using Microservices
Product Team Using Microservices
Product Team Using Monolithic Delivery
Breaking Down the SILOs
QA DBA
Sys
Adm
Net
Adm
SAN
Adm
DevUX
Prod
Mgr
Product Team Using Microservices
Product Team Using Monolithic Delivery
Platform Team
A
P
I
Product Team Using Microservices
Product Team Using Microservices
Product Team Using Monolithic Delivery
Breaking Down the SILOs
QA DBA
Sys
Adm
Net
Adm
SAN
Adm
DevUX
Prod
Mgr
Product Team Using Microservices
Product Team Using Monolithic Delivery
Platform Team
DevOps is a Re-Org
A
P
I
Product Team Using Microservices
Product Team Using Microservices
Product Team Using Monolithic Delivery
Release Plan
Developer
Developer
Developer
Developer
Developer
QA Release
Integration
Ops Replace Old
With New
Release
Monolithic service updates
Works well with a small number
of developers and a single
language like php, java or ruby
Release Plan
Developer
Developer
Developer
Developer
Developer
QA Release
Integration
Ops Replace Old
With New
Release
Bugs
Monolithic service updates
Works well with a small number
of developers and a single
language like php, java or ruby
Release Plan
Developer
Developer
Developer
Developer
Developer
QA Release
Integration
Ops Replace Old
With New
Release
Bugs
Bugs
Monolithic service updates
Works well with a small number
of developers and a single
language like php, java or ruby
Developer
Developer
Developer
Developer
Developer
Old Release Still
Running
Release Plan
Release Plan
Release Plan
Release Plan
Immutable microservice deployment
is faster, scales with large teams and
diverse platform components
Developer
Developer
Developer
Developer
Developer
Old Release Still
Running
Release Plan
Release Plan
Release Plan
Release Plan
Deploy
Feature to
Production
Deploy
Feature to
Production
Deploy
Feature to
Production
Deploy
Feature to
Production
Immutable microservice deployment
is faster, scales with large teams and
diverse platform components
Developer
Developer
Developer
Developer
Developer
Old Release Still
Running
Release Plan
Release Plan
Release Plan
Release Plan
Deploy
Feature to
Production
Deploy
Feature to
Production
Deploy
Feature to
Production
Deploy
Feature to
Production
Bugs
Immutable microservice deployment
is faster, scales with large teams and
diverse platform components
Developer
Developer
Developer
Developer
Developer
Old Release Still
Running
Release Plan
Release Plan
Release Plan
Release Plan
Deploy
Feature to
Production
Deploy
Feature to
Production
Deploy
Feature to
Production
Deploy
Feature to
Production
Bugs
Deploy
Feature to
Production
Immutable microservice deployment
is faster, scales with large teams and
diverse platform components
Non-Destructive Production Updates
● “Immutable Code” Service Pattern
● Existing services are unchanged, old code remains in service
● New code deploys as a new service group
● No impact to production until traffic routing changes
● A|B Tests, Feature Flags and Version Routing control traffic
● First users in the test cell are the developer and test engineers
● A cohort of users is added looking for measurable improvement
● Finally make default for everyone, keeping old code for a while
Developing at the Speed of Docker
Developers
• Compile/Build
• Seconds
Extend container
• Package dependencies
• Seconds
PaaS deploy Container
• Docker startup
• Seconds
etc…
Developing at the Speed of Docker
Emerging market for Docker runtime orchestration options
Developers
• Compile/Build
• Seconds
Extend container
• Package dependencies
• Seconds
PaaS deploy Container
• Docker startup
• Seconds
etc…
What Happened?
Rate of change
increased
Cost and size and
risk of change
reduced
Disruptor:
Continuous Delivery
with Microservices
A Microservice Definition
!
Loosely coupled service oriented
architecture with bounded contexts
A Microservice Definition
!
Loosely coupled service oriented
architecture with bounded contexts
If every service has to be
updated at the same time
it’s not loosely coupled
A Microservice Definition
!
Loosely coupled service oriented
architecture with bounded contexts
If every service has to be
updated at the same time
it’s not loosely coupled
If you have to know too much about surrounding
services you don’t have a bounded context. See the
Domain Driven Design book by Eric Evans.
Separate Concerns with Microservices
http://en.wikipedia.org/wiki/Conway's_law
● Invert Conway’s Law – teams own service groups and backend stores
● One “verb” per single function micro-service, size doesn’t matter
● One developer independently produces a micro-service
● Each micro-service is it’s own build, avoids trunk conflicts
● Deploy in a container: Tomcat, AMI or Docker, whatever…
● Stateless business logic. Cattle, not pets.
● Stateful cached data access layer using replicated ephemeral instances
High Availability Patterns
● Business logic isolation in stateless micro-services
● Immutable code with instant rollback
● Auto-scaled capacity and deployment updates
● Distributed across availability zones and regions
● De-normalized single function NoSQL data stores
● See over 40 NetflixOSS projects at netflix.github.com
● Get “Technical Indigestion” trying to keep up with techblog.netflix.com
US Bandwidth April 2014
US Bandwidth April 2014
ELB
US Bandwidth April 2014
ELB
OpenConnect
Microservices Development
● Client libraries
Even if you start with a raw protocol, a client side driver is the end-state
Best strategy is to own your own client libraries from the start
● Multithreading and Non-blocking Calls
Reactive model RxJava uses Observable to hide concurrency cleanly
Netty can be used to get non-blocking I/O speedup over Tomcat container
● Circuit Breakers – See Fluxcapacitor.com for code
NetflixOSS Hystrix, Turbine, Latency Monkey, Ribbon/Karyon
Also look at Finagle/Zipkin from Twitter
Microservice Datastores
● Book: Refactoring Databases
SchemaSpy to examine schema structure
Denormalization into one datasource per table or materialized view
● Polyglot Persistence
Use a mixture of database technologies, behind REST data access layers
See NetflixOSS Storage Tier as a Service HTTP (staash.com) for MySQL and C*
● CAP – Consistent or Available when Partitioned
Look at Jepsen torture tests for common systems aphyr.com/tags/jepsen
There is no such thing as a consistent distributed system, get over it…
Cloud Native
Monitoring and
Microservices
Cloud Native
● High rate of change
Code pushes can cause floods of new instances and metrics
Short baseline for alert threshold analysis – everything looks unusual
● Ephemeral Configurations
Short lifetimes make it hard to aggregate historical views
Hand tweaked monitoring tools take too much work to keep running
● Microservices with complex calling patterns
End-to-end request flow measurements are very important
Request flow visualizations get overwhelmed
Microservice Based Architectures
See http://www.slideshare.net/LappleApple/gilt-from-monolith-ruby-app-to-micro-service-scala-service-architecture
“Death Star” Architecture Diagrams
As visualized by Appdynamics, Boundary.com and Twitter internal tools
“Death Star” Architecture Diagrams
Netflix Gilt Groupe (12 of 450) Twitter
As visualized by Appdynamics, Boundary.com and Twitter internal tools
Continuous Delivery and DevOps
● Changes are smaller but more frequent
● Individual changes are more likely to be broken
● Changes are normally deployed by developers
● Feature flags are used to enable new code
● Instant detection and rollback matters much more
Whoops! I didn’t mean that!
Reverting…



Not cool if it takes 5 minutes to see it failed and 5 more to see a fix

No-one notices if it only takes 5 seconds to detect and 5 to see a fix
NetflixOSS Hystrix/Turbine Circuit Breaker
http://techblog.netflix.com/2012/12/hystrix-dashboard-and-turbine.html
NetflixOSS Hystrix/Turbine Circuit Breaker
http://techblog.netflix.com/2012/12/hystrix-dashboard-and-turbine.html
Low Latency SaaS Based Monitors
www.vividcortex.com and www.boundary.com
Metric to display latency needs to be
less than human attention span (~10s)
Prototyping Ideas
Model and visualize microservices
!
See github.com/adrianco/spigo
Simulate Protocol Interactions in Go
!
See github.com/adrianco/d3grow
Dynamic visualization concept
Separation of Concerns



Bounded Contexts
Forward Thinking
Forward Thinking
Forward Thinking
Forward Thinking
http://eugenedvorkin.com/seven-micro-services-architecture-advantages/
Any Questions?
Disclosure: some of the companies mentioned are Battery Ventures Portfolio Companies
See www.battery.com for a list of portfolio investments
● Battery Ventures http://www.battery.com
● Adrian’s Blog http://perfcap.blogspot.com
● Slideshare http://slideshare.com/adriancockcroft
!
● Monitorama Opening Keynote Portland OR - May 7
th
, 2014 - Video available
● GOTO Chicago Opening Keynote May 20
th
, 2014 - Video available
● Qcon New York – Speed and Scale - June 11
th
, 2014 - Video available
● Structure - Cloud Trends - San Francisco - June 19th, 2014 - Video available
● GOTO Copenhagen/Aarhus – Denmark – Sept 25
th
, 2014
● DevOps Enterprise Summit - San Francisco - Oct 21-23rd, 2014 #DOES14 - Videos available
● GOTO Berlin - Germany - Nov 6th, 2014
● AWS Re:Invent - Cloud Native Cost Optimization - Las Vegas - November 14th, 2014
● Dockercon Europe - Amsterdam - December 4th, 2014

Goto Berlin - Migrating to Microservices (Fast Delivery)

  • 1.
    Migrating to Microservices AdrianCockcroft @adrianco Technology Fellow - Battery Ventures GOTO Berlin - November 2014
  • 2.
    Typical reactions tomy Netflix talks…
  • 3.
    Typical reactions tomy Netflix talks… “You guys are crazy! Can’t believe it” – 2009
  • 4.
    Typical reactions tomy Netflix talks… “You guys are crazy! Can’t believe it” – 2009 “What Netflix is doing won’t work” – 2010
  • 5.
    Typical reactions tomy Netflix talks… “You guys are crazy! Can’t believe it” – 2009 “What Netflix is doing won’t work” – 2010 It only works for ‘Unicorns’ like Netflix” – 2011
  • 6.
    Typical reactions tomy Netflix talks… “You guys are crazy! Can’t believe it” – 2009 “What Netflix is doing won’t work” – 2010 It only works for ‘Unicorns’ like Netflix” – 2011 “We’d like to do 
 that but can’t” – 2012
  • 7.
    Typical reactions tomy Netflix talks… “You guys are crazy! Can’t believe it” – 2009 “What Netflix is doing won’t work” – 2010 It only works for ‘Unicorns’ like Netflix” – 2011 “We’d like to do 
 that but can’t” – 2012 “We’re on our way using Netflix OSS code” – 2013
  • 8.
    What I learnedfrom my time at Netflix
  • 9.
    What I learnedfrom my time at Netflix •Speed wins in the marketplace
  • 10.
    What I learnedfrom my time at Netflix •Speed wins in the marketplace •Remove friction from product development
  • 11.
    What I learnedfrom my time at Netflix •Speed wins in the marketplace •Remove friction from product development •High trust, low process, no hand-offs between teams
  • 12.
    What I learnedfrom my time at Netflix •Speed wins in the marketplace •Remove friction from product development •High trust, low process, no hand-offs between teams •Freedom and responsibility culture
  • 13.
    What I learnedfrom my time at Netflix •Speed wins in the marketplace •Remove friction from product development •High trust, low process, no hand-offs between teams •Freedom and responsibility culture •Don’t do your own undifferentiated heavy lifting
  • 14.
    What I learnedfrom my time at Netflix •Speed wins in the marketplace •Remove friction from product development •High trust, low process, no hand-offs between teams •Freedom and responsibility culture •Don’t do your own undifferentiated heavy lifting •Use simple patterns automated by tooling
  • 15.
    What I learnedfrom my time at Netflix •Speed wins in the marketplace •Remove friction from product development •High trust, low process, no hand-offs between teams •Freedom and responsibility culture •Don’t do your own undifferentiated heavy lifting •Use simple patterns automated by tooling •Self service cloud makes impossible things instant
  • 16.
    Cloud Adoption %*&!” By SimonWardley http://enterpriseitadoption.com/
  • 17.
    Cloud Adoption %*&!” By SimonWardley http://enterpriseitadoption.com/ 2009
  • 18.
    Cloud Adoption %*&!” By SimonWardley http://enterpriseitadoption.com/ 2009
  • 19.
    Cloud Adoption @adrianco’s new jobat the intersection of cloud and Enterprise IT %*&!” By Simon Wardley http://enterpriseitadoption.com/ 20142009
  • 20.
    This is theyear that Enterprises finally embraced cloud.
  • 21.
    This is theyear that Enterprises finally embraced cloud.
  • 22.
    This is theyear that Enterprises finally embraced cloud.
  • 23.
    This is theyear that Enterprises finally embraced cloud.
  • 24.
  • 25.
    “It isn't whatwe don't know that gives us trouble, it's what we know that ain't so.” ! Will Rogers
  • 26.
  • 27.
  • 28.
  • 29.
    Organizations build up slowcomplex “Scar tissue” processes
  • 30.
    "This is theIT swamp draining manual for anyone who is neck deep in alligators.” 1984 2014
  • 31.
  • 32.
  • 33.
    Observe Orient Decide Act Land grab opportunity Competitive Move CustomerPain Point Measure Customers Continuous Delivery
  • 34.
    Observe Orient Decide Act Land grab opportunity Competitive Move CustomerPain Point INNOVATION Measure Customers Continuous Delivery
  • 35.
    Observe Orient Decide Act Land grab opportunity Competitive Move CustomerPain Point Analysis Model Hypotheses INNOVATION Measure Customers Continuous Delivery
  • 36.
    Observe Orient Decide Act Land grab opportunity Competitive Move CustomerPain Point Analysis Model Hypotheses BIG DATA INNOVATION Measure Customers Continuous Delivery
  • 37.
    Observe Orient Decide Act Land grab opportunity Competitive Move CustomerPain Point Analysis JFDI Plan Response Share Plans Model Hypotheses BIG DATA INNOVATION Measure Customers Continuous Delivery
  • 38.
    Observe Orient Decide Act Land grab opportunity Competitive Move CustomerPain Point Analysis JFDI Plan Response Share Plans Model Hypotheses BIG DATA INNOVATION CULTURE Measure Customers Continuous Delivery
  • 39.
    Observe Orient Decide Act Land grab opportunity Competitive Move CustomerPain Point Analysis JFDI Plan Response Share Plans Incremental Features Automatic Deploy Launch AB Test Model Hypotheses BIG DATA INNOVATION CULTURE Measure Customers Continuous Delivery
  • 40.
    Observe Orient Decide Act Land grab opportunity Competitive Move CustomerPain Point Analysis JFDI Plan Response Share Plans Incremental Features Automatic Deploy Launch AB Test Model Hypotheses BIG DATA INNOVATION CULTURE CLOUD Measure Customers Continuous Delivery
  • 41.
    Observe Orient Decide Act Land grab opportunity Competitive Move CustomerPain Point Analysis JFDI Plan Response Share Plans Incremental Features Automatic Deploy Launch AB Test Model Hypotheses BIG DATA INNOVATION CULTURE CLOUD Measure Customers Continuous Delivery
  • 42.
    Observe Orient Decide Act Land grab opportunity Competitive Move CustomerPain Point Analysis JFDI Plan Response Share Plans Incremental Features Automatic Deploy Launch AB Test Model Hypotheses BIG DATA INNOVATION CULTURE CLOUD Measure Customers Continuous Delivery
  • 43.
  • 44.
    Breaking Down theSILOs QA DBA Sys Adm Net Adm SAN Adm DevUX Prod Mgr
  • 45.
    Breaking Down theSILOs QA DBA Sys Adm Net Adm SAN Adm DevUX Prod Mgr Product Team Using Monolithic Delivery Product Team Using Monolithic Delivery
  • 46.
    Breaking Down theSILOs QA DBA Sys Adm Net Adm SAN Adm DevUX Prod Mgr Product Team Using Microservices Product Team Using Monolithic Delivery Product Team Using Microservices Product Team Using Microservices Product Team Using Monolithic Delivery
  • 47.
    Breaking Down theSILOs QA DBA Sys Adm Net Adm SAN Adm DevUX Prod Mgr Product Team Using Microservices Product Team Using Monolithic Delivery Platform TeamProduct Team Using Microservices Product Team Using Microservices Product Team Using Monolithic Delivery
  • 48.
    Breaking Down theSILOs QA DBA Sys Adm Net Adm SAN Adm DevUX Prod Mgr Product Team Using Microservices Product Team Using Monolithic Delivery Platform Team A P I Product Team Using Microservices Product Team Using Microservices Product Team Using Monolithic Delivery
  • 49.
    Breaking Down theSILOs QA DBA Sys Adm Net Adm SAN Adm DevUX Prod Mgr Product Team Using Microservices Product Team Using Monolithic Delivery Platform Team DevOps is a Re-Org A P I Product Team Using Microservices Product Team Using Microservices Product Team Using Monolithic Delivery
  • 50.
    Release Plan Developer Developer Developer Developer Developer QA Release Integration OpsReplace Old With New Release Monolithic service updates Works well with a small number of developers and a single language like php, java or ruby
  • 51.
    Release Plan Developer Developer Developer Developer Developer QA Release Integration OpsReplace Old With New Release Bugs Monolithic service updates Works well with a small number of developers and a single language like php, java or ruby
  • 52.
    Release Plan Developer Developer Developer Developer Developer QA Release Integration OpsReplace Old With New Release Bugs Bugs Monolithic service updates Works well with a small number of developers and a single language like php, java or ruby
  • 53.
    Developer Developer Developer Developer Developer Old Release Still Running ReleasePlan Release Plan Release Plan Release Plan Immutable microservice deployment is faster, scales with large teams and diverse platform components
  • 54.
    Developer Developer Developer Developer Developer Old Release Still Running ReleasePlan Release Plan Release Plan Release Plan Deploy Feature to Production Deploy Feature to Production Deploy Feature to Production Deploy Feature to Production Immutable microservice deployment is faster, scales with large teams and diverse platform components
  • 55.
    Developer Developer Developer Developer Developer Old Release Still Running ReleasePlan Release Plan Release Plan Release Plan Deploy Feature to Production Deploy Feature to Production Deploy Feature to Production Deploy Feature to Production Bugs Immutable microservice deployment is faster, scales with large teams and diverse platform components
  • 56.
    Developer Developer Developer Developer Developer Old Release Still Running ReleasePlan Release Plan Release Plan Release Plan Deploy Feature to Production Deploy Feature to Production Deploy Feature to Production Deploy Feature to Production Bugs Deploy Feature to Production Immutable microservice deployment is faster, scales with large teams and diverse platform components
  • 57.
    Non-Destructive Production Updates ●“Immutable Code” Service Pattern ● Existing services are unchanged, old code remains in service ● New code deploys as a new service group ● No impact to production until traffic routing changes ● A|B Tests, Feature Flags and Version Routing control traffic ● First users in the test cell are the developer and test engineers ● A cohort of users is added looking for measurable improvement ● Finally make default for everyone, keeping old code for a while
  • 58.
    Developing at theSpeed of Docker Developers • Compile/Build • Seconds Extend container • Package dependencies • Seconds PaaS deploy Container • Docker startup • Seconds etc…
  • 59.
    Developing at theSpeed of Docker Emerging market for Docker runtime orchestration options Developers • Compile/Build • Seconds Extend container • Package dependencies • Seconds PaaS deploy Container • Docker startup • Seconds etc…
  • 60.
    What Happened? Rate ofchange increased Cost and size and risk of change reduced
  • 61.
  • 62.
    A Microservice Definition ! Looselycoupled service oriented architecture with bounded contexts
  • 63.
    A Microservice Definition ! Looselycoupled service oriented architecture with bounded contexts If every service has to be updated at the same time it’s not loosely coupled
  • 64.
    A Microservice Definition ! Looselycoupled service oriented architecture with bounded contexts If every service has to be updated at the same time it’s not loosely coupled If you have to know too much about surrounding services you don’t have a bounded context. See the Domain Driven Design book by Eric Evans.
  • 65.
    Separate Concerns withMicroservices http://en.wikipedia.org/wiki/Conway's_law ● Invert Conway’s Law – teams own service groups and backend stores ● One “verb” per single function micro-service, size doesn’t matter ● One developer independently produces a micro-service ● Each micro-service is it’s own build, avoids trunk conflicts ● Deploy in a container: Tomcat, AMI or Docker, whatever… ● Stateless business logic. Cattle, not pets. ● Stateful cached data access layer using replicated ephemeral instances
  • 66.
    High Availability Patterns ●Business logic isolation in stateless micro-services ● Immutable code with instant rollback ● Auto-scaled capacity and deployment updates ● Distributed across availability zones and regions ● De-normalized single function NoSQL data stores ● See over 40 NetflixOSS projects at netflix.github.com ● Get “Technical Indigestion” trying to keep up with techblog.netflix.com
  • 67.
  • 68.
  • 69.
    US Bandwidth April2014 ELB OpenConnect
  • 70.
    Microservices Development ● Clientlibraries Even if you start with a raw protocol, a client side driver is the end-state Best strategy is to own your own client libraries from the start ● Multithreading and Non-blocking Calls Reactive model RxJava uses Observable to hide concurrency cleanly Netty can be used to get non-blocking I/O speedup over Tomcat container ● Circuit Breakers – See Fluxcapacitor.com for code NetflixOSS Hystrix, Turbine, Latency Monkey, Ribbon/Karyon Also look at Finagle/Zipkin from Twitter
  • 71.
    Microservice Datastores ● Book:Refactoring Databases SchemaSpy to examine schema structure Denormalization into one datasource per table or materialized view ● Polyglot Persistence Use a mixture of database technologies, behind REST data access layers See NetflixOSS Storage Tier as a Service HTTP (staash.com) for MySQL and C* ● CAP – Consistent or Available when Partitioned Look at Jepsen torture tests for common systems aphyr.com/tags/jepsen There is no such thing as a consistent distributed system, get over it…
  • 72.
  • 73.
    Cloud Native ● Highrate of change Code pushes can cause floods of new instances and metrics Short baseline for alert threshold analysis – everything looks unusual ● Ephemeral Configurations Short lifetimes make it hard to aggregate historical views Hand tweaked monitoring tools take too much work to keep running ● Microservices with complex calling patterns End-to-end request flow measurements are very important Request flow visualizations get overwhelmed
  • 74.
    Microservice Based Architectures Seehttp://www.slideshare.net/LappleApple/gilt-from-monolith-ruby-app-to-micro-service-scala-service-architecture
  • 75.
    “Death Star” ArchitectureDiagrams As visualized by Appdynamics, Boundary.com and Twitter internal tools
  • 76.
    “Death Star” ArchitectureDiagrams Netflix Gilt Groupe (12 of 450) Twitter As visualized by Appdynamics, Boundary.com and Twitter internal tools
  • 77.
    Continuous Delivery andDevOps ● Changes are smaller but more frequent ● Individual changes are more likely to be broken ● Changes are normally deployed by developers ● Feature flags are used to enable new code ● Instant detection and rollback matters much more
  • 78.
    Whoops! I didn’tmean that! Reverting…
 
 Not cool if it takes 5 minutes to see it failed and 5 more to see a fix
 No-one notices if it only takes 5 seconds to detect and 5 to see a fix
  • 79.
    NetflixOSS Hystrix/Turbine CircuitBreaker http://techblog.netflix.com/2012/12/hystrix-dashboard-and-turbine.html
  • 80.
    NetflixOSS Hystrix/Turbine CircuitBreaker http://techblog.netflix.com/2012/12/hystrix-dashboard-and-turbine.html
  • 81.
    Low Latency SaaSBased Monitors www.vividcortex.com and www.boundary.com
  • 82.
    Metric to displaylatency needs to be less than human attention span (~10s)
  • 83.
    Prototyping Ideas Model andvisualize microservices ! See github.com/adrianco/spigo Simulate Protocol Interactions in Go ! See github.com/adrianco/d3grow Dynamic visualization concept
  • 84.
  • 85.
  • 86.
  • 87.
  • 88.
  • 89.
    Any Questions? Disclosure: someof the companies mentioned are Battery Ventures Portfolio Companies See www.battery.com for a list of portfolio investments ● Battery Ventures http://www.battery.com ● Adrian’s Blog http://perfcap.blogspot.com ● Slideshare http://slideshare.com/adriancockcroft ! ● Monitorama Opening Keynote Portland OR - May 7 th , 2014 - Video available ● GOTO Chicago Opening Keynote May 20 th , 2014 - Video available ● Qcon New York – Speed and Scale - June 11 th , 2014 - Video available ● Structure - Cloud Trends - San Francisco - June 19th, 2014 - Video available ● GOTO Copenhagen/Aarhus – Denmark – Sept 25 th , 2014 ● DevOps Enterprise Summit - San Francisco - Oct 21-23rd, 2014 #DOES14 - Videos available ● GOTO Berlin - Germany - Nov 6th, 2014 ● AWS Re:Invent - Cloud Native Cost Optimization - Las Vegas - November 14th, 2014 ● Dockercon Europe - Amsterdam - December 4th, 2014