SlideShare a Scribd company logo
PRACTICAL 
CONSIDERATIONS 
FOR MICRO SERVICES 
Sam Newman 
Javazone 2014, September 2014 
1
14 PRACTICAL TIPS 
FOR MICROSERVICES 
Sam Newman 
Javazone 2014, September 2014 
2
YOU WON’T BELIEVE 
WHAT THEY DO WITH 
MICROSERVICES IN 
THIS TALK! 
Sam Newman 
Javazone 2014, September 2014 
3
SEE WHAT JENNIFER 
LAWRENCE THINKS 
ABOUT DISTRIBUTED 
SYSTEMS! 
Sam Newman 
Javazone 2014, September 2014 
4
Customer 
Service 
Accounts 
Returns 
Invoicing 
Shipping 
Inventory 
@javazone @samnewman
Focused around a business 
domain 
Customer 
Service 
Accounts 
Returns 
Invoicing 
Shipping 
Inventory 
@javazone @samnewman
Focused around a business 
domain 
Customer 
Service 
Technology Agnostic API 
Accounts 
Returns 
Invoicing 
Shipping 
Inventory 
@javazone @samnewman
Focused around a business 
domain 
Customer 
Service 
Technology Agnostic API 
Small 
Accounts 
Returns 
Invoicing 
Shipping 
Inventory 
@javazone @samnewman
@javazone @samnewman
@javazone @samnewman
V1 
@javazone @samnewman
V2 
@javazone @samnewman
Go 
Java 
NodeJS 
Ruby 
@javazone @samnewman
Go 
NodeJS 
Ruby 
Clojure! 
@javazone @samnewman
@javazone @samnewman
@javazone @samnewman
@javazone @samnewman
@javazone @samnewman
Where To Standardise? 
@javazone @samnewman
@javazone @samnewman 
© 2013 Electronic Arts Inc.
@javazone @samnewman
Interfaces 
@javazone @samnewman
Interfaces 
Monitoring 
@javazone @samnewman
Interfaces 
Monitoring 
Deployment & Testing 
@javazone @samnewman
Architectural Safety 
@javazone @samnewman
@javazone @samnewman
Free For All 
@javazone @samnewman
Standardisation 
Free For All 
@javazone @samnewman
Standardisation 
TIP 1 / 14: Standardise in the gaps between services - 
be flexible about what happens inside the boxes 
Free For All 
@javazone @samnewman
@javazone @samnewman
@javazone @samnewman
@javazone @samnewman
@javazone @samnewman
@javazone @samnewman
@javazone @samnewman 
https://www.flickr.com/photos/garrymsmith/6108841070
Autonomy 
Communication 
@javazone @samnewman
Team Ownership 
@javazone @samnewman
Team Ownership 
??? 
@javazone @samnewman
Trusted Committer / 
Roving Custodian 
@javazone @samnewman
Trusted Committer / 
Roving Custodian 
??? 
@javazone @samnewman
Trusted Committer / 
Roving Custodian 
??? 
@javazone @samnewman
Trusted Committer / 
Roving Custodian 
??? 
@javazone @samnewman
Trusted Committer / 
Roving Custodian 
??? 
@javazone @samnewman
Trusted Committer / 
Roving Custodian 
??? 
@javazone @samnewman
Trusted Committer / 
Roving Custodian 
TIP 2 / 14: Have a cle?a?r ?custodian model! 
@javazone @samnewman
Interfaces 
@javazone @samnewman
@javazone @samnewman
@javazone @samnewman
@javazone @samnewman
Coupling Is Bad 
@javazone @samnewman
Integration Styles 
An Evolutionary View 
Data Oriented Procedure 
Oriented 
Document 
Oriented 
Resource 
Oriented 
@javazone @samnewman
Integration Styles 
An Evolutionary View 
Data Oriented Procedure 
Oriented 
Document 
Oriented 
Resource 
Oriented 
@javazone @samnewman
Integration Styles 
An Evolutionary View 
TIP 3 / 14: Avoid RPC-mechanisms or shared 
serialisation protocols to avoid coupling 
Data Oriented Procedure 
Oriented 
Document 
Oriented 
Resource 
Oriented 
@javazone @samnewman
Database 
@javazone @samnewman
Database 
@javazone @samnewman
Database 
@javazone @samnewman
Database 
@javazone @samnewman
Database 
@javazone @samnewman
Database 
@javazone @samnewman
Database 
@javazone @samnewman
Database Database 
@javazone @samnewman
Database Database 
@javazone @samnewman
TIP 4 / 14: Separate the databases before separating services 
Database Database 
@javazone @samnewman
The Customer Is Always Right 
@javazone @samnewman
@javazone @samnewman
@javazone @samnewman
TIP 5 / 14: Adopt a consumer first approach 
@javazone @samnewman
Monitoring 
@javazone @samnewman
@javazone @samnewman
http://www.flickr.com/photos/kalexanderson/5421517469/ 
@javazone @samnewman
http://www.flickr.com/photos/kalexanderson/5421517469/ 
@javazone @samnewman
@javazone @samnewman
@javazone @samnewman
??? 
@javazone @samnewman
You have to get *much* 
better at monitoring 
@javazone @samnewman
@javazone @samnewman
@javazone @samnewman
@javazone @samnewman
@javazone @samnewman
You are not a badass if you 
use an SSH Multiplexer 
@javazone @samnewman
@javazone @samnewman
@javazone @samnewman
@javazone @samnewman
Response Time 
Response Time 
Response Time 
@javazone @samnewman
Response Time 
Response Time 
Response Time 
@javazone @samnewman
Response Time 
Response Time 
Response Time 
@javazone @samnewman
@javazone @samnewman
@javazone @samnewman
TIP 6 / 14: Capture metrics, and logs, for each node, 
and aggregate them to get a rolled up picture 
@javazone @samnewman
@javazone @samnewman
@javazone @samnewman
@javazone @samnewman
TIP 7 / 14: Use synthetic transactions to test 
production systems 
@javazone @samnewman
@javazone @samnewman
@javazone @samnewman
@javazone @samnewman
ID: 123 
@javazone @samnewman
ID: 123 
ID: 123 
ID: 123 
@javazone @samnewman
ID: 123 
TIP 8 / 14: Use correlation IDs to track down nasty bugs 
ID: 123 
ID: 123 
@javazone @samnewman
Deployment 
@javazone @samnewman
@javazone @samnewman
@javazone @samnewman
@javazone @samnewman
! 
@javazone @samnewman
! 
! 
@javazone @samnewman
! 
! 
! 
@javazone @samnewman
@javazone @samnewman
@javazone @samnewman
@javazone @samnewman
TIP 9 / 14: Abstract out underlying platform 
differences to provide a uniform deployment 
mechanism 
@javazone @samnewman
Shipping 
Inventory 
Customer 
Service 
Accounts 
Returns 
Invoicing 
@javazone @samnewman
Customer 
Service 
Accounts 
Returns 
Invoicing 
Shipping 
Inventory 
@javazone @samnewman
Customer 
Service 
Accounts 
Returns 
Invoicing 
Shipping 
Inventory 
@javazone @samnewman
Inventory Accounts 
Mountebank 
http://www.mbtest.org 
@javazone @samnewman
Inventory 
Accounts! 
Stub 
Mountebank 
http://www.mbtest.org 
@javazone @samnewman
Shipping 
Inventory 
Customer 
Service 
Accounts 
Returns 
Invoicing 
@javazone @samnewman
Shipping 
Inventory 
Customer 
Service 
Accounts 
Returns 
Invoicing 
@javazone @samnewman
Shipping 
Inventory 
Customer 
Service 
Accounts 
Returns 
Invoicing 
@javazone @samnewman
Shipping 
Inventory 
Customer 
Service 
Accounts 
Returns 
Invoicing 
@javazone @samnewman
Shipping 
Inventory 
Customer 
Service 
Accounts 
Returns 
Invoicing 
@javazone @samnewman
@javazone @samnewman
Browsers 
@javazone @samnewman
Timing 
Browsers 
@javazone @samnewman
Provisioning of Environments 
Timing 
Browsers 
@javazone @samnewman
Networks 
Provisioning of Environments 
Timing 
Browsers 
@javazone @samnewman
Deployment 
Networks 
Provisioning of Environments 
Timing 
Browsers 
@javazone @samnewman
Deployment 
Networks 
Provisioning of Environments 
Timing 
Browsers Diagnosis 
@javazone @samnewman
CONSUMER-DRIVEN CONTRACTS 
Shipping Inventory 
@javazone @samnewman
CONSUMER-DRIVEN CONTRACTS 
Shipping Inventory 
Expectations 
@javazone @samnewman
CONSUMER-DRIVEN CONTRACTS 
Shipping Inventory 
Expectations 
@javazone @samnewman
CONSUMER-DRIVEN CONTRACTS 
Shipping Inventory 
Expectations 
Prod 
@javazone @samnewman
CONSUMER-DRIVEN CONTRACTS 
Shipping Inventory 
Expectations 
Prod 
@javazone @samnewman
@javazone @samnewman
https://github.com/realestate-com-au/pact 
@javazone @samnewman
TIP 10 / 14: Consumer Driven Tests to catch breaking changes 
https://github.com/realestate-com-au/pact 
@javazone @samnewman
Pending… Prod
Pending… Prod
Pending… Prod
Pending… Prod
Pending… Prod
Pending… Prod 
TIP 11 / 14: Don’t let changes build up - release as 
soon as you can, and preferably one at a time!
Architectural Safety 
@javazone @samnewman
@javazone @samnewman
@javazone @samnewman
@javazone @samnewman
@javazone @samnewman
http://www.flickr.com/photos/louish/5611657857/ 
@javazone @samnewman
Connection Pool 
@javazone @samnewman
Connection Pool 
@javazone @samnewman
Connection Pool 
@javazone @samnewman
Connection Pool 
@javazone @samnewman
Connection 
Pool 
Connection 
Pool 
@javazone @samnewman
Connection 
Pool 
Connection 
Pool 
@javazone @samnewman
Connection 
Pool 
Connection 
Pool 
@javazone @samnewman
Connection 
Pool 
Connection 
Pool 
@javazone @samnewman
@javazone @samnewman
@javazone @samnewman
@javazone @samnewman
TIP 12 / 14: Use timeouts, circuit breakers and bulk-heads 
to avoid cascading failure 
@javazone @samnewman
Special Service Behaviour 
@javazone @samnewman
Integration 
Special Service Behaviour 
@javazone @samnewman
Integration 
Special Service Behaviour 
Downstream 
@javazone @samnewman
Integration 
Special Service Behaviour 
Downstream 
Metrics 
@javazone @samnewman
Integration 
Special Service Behaviour 
Downstream 
Metrics 
@javazone @samnewman
Integration 
Special Service Behaviour 
Downstream 
Metrics 
@javazone @samnewman
Integration 
Special Service Behaviour 
Metrics TIP 13 / 14: Consider Service Templates to make it 
easy to do the right thing! 
Downstream 
@javazone @samnewman
@javazone @samnewman
@javazone @samnewman
@javazone @samnewman
@javazone @samnewman
Choice! 
Opportunity 
@javazone @samnewman
Choice! 
Opportunity 
Complexity 
@javazone @samnewman
Choice! 
Opportunity 
Monitoring Complexity 
Deployment 
Safety 
Integration 
@javazone @samnewman
Choice! 
Opportunity 
TIP 14 / 14: Find your own balance 
Monitoring Complexity 
Deployment 
Safety 
Integration 
@javazone @samnewman
62 
Building 
Microservices 
DESIGNING FINE-GRAINED SYSTEMS 
Sam Newman
Designing For ! 
Rapid Release 
500 West Madison 
500 West Madison 
@javazone @samnewman
500 West Madison 
500 West Madison 
From Macro To Micro 
Designing For ! 
Rapid Release 
@javazone @samnewman
500 West Madison 
500 West Madison 
From Macro To Micro 
Designing For ! 
Rapid Release 
http://lanyrd.com/profile/samnewman/ 
@javazone @samnewman
THANKS! 
Any questions: 
@samnewman 
snewman@thoughtworks.com

More Related Content

PDF
AppSec & Microservices - Velocity 2016
PDF
Practical microservices - NDC 2014
PDF
Practical microservices - YOW 2013
PDF
Testing & deploying microservices - XP Days Ukraine 2014
PDF
Deploying and Scaling Microservices
PDF
AppSec And Microservices
PDF
Principles of microservices XP Days Ukraine
PDF
From macro to micro goto
AppSec & Microservices - Velocity 2016
Practical microservices - NDC 2014
Practical microservices - YOW 2013
Testing & deploying microservices - XP Days Ukraine 2014
Deploying and Scaling Microservices
AppSec And Microservices
Principles of microservices XP Days Ukraine
From macro to micro goto

What's hot (20)

PDF
Principles of Microservices - NDC 2014
PDF
BETA - Securing microservices
PDF
Testing & deploying Microservices GeeCon 2014
PDF
Feature Branches And Toggles In A Post-GitHub World
PDF
Confusion In The Land Of The Serverless - 90min Version
PDF
It's a trap!
PDF
Confusion In The Land Of The Serverless
PDF
AppSec and Microservices
PDF
Hiding The Lead: Coupling, cohesion and microservices
PDF
What Is This Cloud Native Thing Anyway?
PPTX
Ramp up your Mobile Content Slideshow
PDF
THE UX OF DATA - VISUALIZATION RESPONSIVE
PDF
Webinar #5: Mobile indsigter og trends ft. Google
PDF
SEO for Angular - BrightonSEO 2018
PDF
Designing the Priority, Performance ist User Experience
PDF
The UX of DATA: Responsive Datenvisualisierung mit jQuery
PDF
Performance and UX
PDF
Hassliebe Onlineformulare, Enhance your Form for better UX
PDF
Observability - Experiencing the “why” behind the jargon (FlowCon 2019)
PDF
Google Tag Manager Crash Course | MnSummit
Principles of Microservices - NDC 2014
BETA - Securing microservices
Testing & deploying Microservices GeeCon 2014
Feature Branches And Toggles In A Post-GitHub World
Confusion In The Land Of The Serverless - 90min Version
It's a trap!
Confusion In The Land Of The Serverless
AppSec and Microservices
Hiding The Lead: Coupling, cohesion and microservices
What Is This Cloud Native Thing Anyway?
Ramp up your Mobile Content Slideshow
THE UX OF DATA - VISUALIZATION RESPONSIVE
Webinar #5: Mobile indsigter og trends ft. Google
SEO for Angular - BrightonSEO 2018
Designing the Priority, Performance ist User Experience
The UX of DATA: Responsive Datenvisualisierung mit jQuery
Performance and UX
Hassliebe Onlineformulare, Enhance your Form for better UX
Observability - Experiencing the “why” behind the jargon (FlowCon 2019)
Google Tag Manager Crash Course | MnSummit
Ad

Viewers also liked (6)

PDF
микроСЕРВИСЫ: огонь, вода и медные трубы
PDF
MicroService Architecture
PDF
Dockercon State of the Art in Microservices
PDF
Developing event-driven microservices with event sourcing and CQRS (svcc, sv...
PDF
Principles of microservices velocity
PPT
Down-to-Earth Microservices with Java EE
микроСЕРВИСЫ: огонь, вода и медные трубы
MicroService Architecture
Dockercon State of the Art in Microservices
Developing event-driven microservices with event sourcing and CQRS (svcc, sv...
Principles of microservices velocity
Down-to-Earth Microservices with Java EE
Ad

Similar to Practical microservices - javazone 2014 (20)

PDF
Greach 2018: Surviving Microservices
PDF
Surviving in a microservices environment
PDF
Integration strategies best practices- Mulesoft meetup April 2018
PDF
Microservices for java architects schamburg-2015-05-19
PDF
Microservices for Java Architects (Madison-Milwaukee, April 28-9, 2015)
PDF
Microservices for Java Architects (Chicago, April 21, 2015)
PPT
J2EE Performance And Scalability Bp
PDF
Caching for Microservices Architectures: Session II - Caching Patterns
PDF
Microservices for java architects coders-conf-2015-05-15
ODP
Best practice adoption (and lack there of)
PDF
Microservices for Java Architects (Indianapolis, April 15, 2015)
PPTX
From Code to Commerce, a Backend Java Developer's Galactic Journey into Ecomm...
PDF
Common blind spots on the journey to production vijay raghavan aravamudhan
PPTX
Pragmatic Approach to Microservices and Cell-based Architecture
PDF
Architecting Cloud Applications - the essential checklist
PPTX
Old code doesn't stink
PPT
Windows Azure Essentials V3
PDF
Simple Pure Java
PPTX
Big Data Anti-Patterns: Lessons From the Front LIne
PDF
Agile Australia 2014: Workshop - Design and Implementation of Microservices
Greach 2018: Surviving Microservices
Surviving in a microservices environment
Integration strategies best practices- Mulesoft meetup April 2018
Microservices for java architects schamburg-2015-05-19
Microservices for Java Architects (Madison-Milwaukee, April 28-9, 2015)
Microservices for Java Architects (Chicago, April 21, 2015)
J2EE Performance And Scalability Bp
Caching for Microservices Architectures: Session II - Caching Patterns
Microservices for java architects coders-conf-2015-05-15
Best practice adoption (and lack there of)
Microservices for Java Architects (Indianapolis, April 15, 2015)
From Code to Commerce, a Backend Java Developer's Galactic Journey into Ecomm...
Common blind spots on the journey to production vijay raghavan aravamudhan
Pragmatic Approach to Microservices and Cell-based Architecture
Architecting Cloud Applications - the essential checklist
Old code doesn't stink
Windows Azure Essentials V3
Simple Pure Java
Big Data Anti-Patterns: Lessons From the Front LIne
Agile Australia 2014: Workshop - Design and Implementation of Microservices

Recently uploaded (20)

PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
MYSQL Presentation for SQL database connectivity
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Machine learning based COVID-19 study performance prediction
PPTX
Cloud computing and distributed systems.
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
sap open course for s4hana steps from ECC to s4
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Approach and Philosophy of On baking technology
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
Understanding_Digital_Forensics_Presentation.pptx
Chapter 3 Spatial Domain Image Processing.pdf
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Spectral efficient network and resource selection model in 5G networks
MYSQL Presentation for SQL database connectivity
MIND Revenue Release Quarter 2 2025 Press Release
Machine learning based COVID-19 study performance prediction
Cloud computing and distributed systems.
Per capita expenditure prediction using model stacking based on satellite ima...
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
sap open course for s4hana steps from ECC to s4
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Building Integrated photovoltaic BIPV_UPV.pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Encapsulation_ Review paper, used for researhc scholars
Network Security Unit 5.pdf for BCA BBA.
Approach and Philosophy of On baking technology
The Rise and Fall of 3GPP – Time for a Sabbatical?
Understanding_Digital_Forensics_Presentation.pptx

Practical microservices - javazone 2014