Post on 06-Apr-2017
transcript
THE DARK SIDE OF MICRO-SERVICES@NICOLAS_FRANKEL
#microservices 2
ME, MYSELF AND I
@nicolas_frankel
Developer/Software -/Solution Architect• Java• As consultant
#microservices@nicolas_frankel #springboot 3
HYBRIS, AN SAP COMPANY
#microservices@nicolas_frankel 4
MICRO-SERVICES ON PAPER
#microservices@nicolas_frankel 5
QUOTE OF THE DAY
“[…] if people can't build monoliths properly, microservices won't help”
- Simon Brown
https://twitter.com/simonbrown/status/573072777147777024
https://genehughson.wordpress.com/2015/03/08/microservice-architectures-arent-for-everyone/
#microservices@nicolas_frankel 6
QUOTE OF THE DAY
“I see you have a poorly structured monolith. Would you like me to convert it into a poorly structured set of microservices?”
- Architect Clippy
https://twitter.com/architectclippy/status/570025079825764352
https://genehughson.wordpress.com/2015/03/08/microservice-architectures-arent-for-everyone/
#microservices@nicolas_frankel 7
MICRO-SERVICES IN REAL LIFE
#microservices@nicolas_frankel 8
SUMMARY
What are micro-services?What benefits to expect?What requirements?What’s in it for you now?
#microservices 9@nicolas_frankel
A TENTATIVE DEFINITION
THE DARK SIDE OF MICRO-SERVICES
#microservices@nicolas_frankel 10
THE MONOLITH
“A monolithic application puts all its functionality into a single process…”
http://martinfowler.com/articles/microservices.html
#microservices@nicolas_frankel 11
SCALING A MONOLITH
“… and scales by replicating the monolith on different servers”
#microservices@nicolas_frankel 12
ASSUMPTION
All functionalities of your application have the same load• Really?
#microservices@nicolas_frankel 13
EXAMPLE: E-COMMERCE SHOP
CatalogCartLoginPaymentetc.
#microservices@nicolas_frankel 14
MICRO-SERVICES
“A microservices architecture puts each element of functionality into a separate service…”
#microservices@nicolas_frankel 15
SCALING MICRO-SERVICES
“… and scales by distributing these services across servers, scaling as needed”
#microservices@nicolas_frankel 16
SINGLE RESPONSIBILITY PRINCIPLE
Component-based Wrapping a single business
capability• Fine-grained
Decoupled from one another
Communicating via simple channels
#microservices 17@nicolas_frankel
BENEFITS
THE DARK SIDE OF MICRO-SERVICES
#microservices@nicolas_frankel 18
DIFFERENTIAL SCALING
Optimizing resources
#microservices@nicolas_frankel 19
DECOUPLED LIFECYCLES
Enable continuous delivery•No more release trains!
#microservices@nicolas_frankel 20
CONTINUOUS/EVOLUTIONARY DESIGN
No necessary fixed upfront design•Allows for continuous changes
#microservices@nicolas_frankel 21
POLYGLOT PERSISTENCE
Choose the best persistence tier for the job
#microservices@nicolas_frankel 22
POLYGLOT
Choose the best language for the job
#microservices@nicolas_frankel 23
THE FIRST AND FOREMOST BENEFIT
Scaling your development team!
#microservices 24@nicolas_frankel
REQUIREMENTS
THE DARK SIDE OF MICRO-SERVICES
#microservices@nicolas_frankel 25
INFRASTRUCTURE AUTOMATION
To deliver continuously
#microservices@nicolas_frankel 26
FORMALIZED DOCUMENTATION
To help service users
#microservices@nicolas_frankel 27
MONITORING
Cross-components
#microservices 29@nicolas_frankel
CORE ISSUES
THE DARK SIDE OF MICRO-SERVICES
#microservices@nicolas_frankel 30
#microservices@nicolas_frankel 31
THE NETWORK!
From a simple API call to a network call…
#microservices@nicolas_frankel 32
FALLACIES OF DISTRIBUTED COMPUTING
1. The network is reliable.2. Latency is zero.3. Bandwidth is infinite.4. The network is secure.5. Topology doesn’t change.6. There is one administrator.7. Transport cost is zero.8. The network is homogeneous.
#microservices@nicolas_frankel 33
NEW PROBLEMS ARISE
Latency•Asynchronicity• Performance drop
#microservices@nicolas_frankel 34
NEW PROBLEMS ARISE
Handling failures•Different handling•Unavailable service
#microservices@nicolas_frankel 35
NEW PROBLEMS ARISE
Serialization/deserialization• Performance drop
#microservices@nicolas_frankel 36
STRIKE A BALANCE
Between scalability and performance
#microservices@nicolas_frankel 37
NOT ONLY TECHNICAL ISSUES
#microservices@nicolas_frankel 38
AGILE?
Trying to do agileDoing agileBeing agile
#microservices@nicolas_frankel 39
ORGANIZING TEAMS
Limited size• Fed by 2 pizzas
AutonomousSelf-organizing
#microservices@nicolas_frankel 40
CONWAY’S LAW
“organizations which design systems ... are constrained to produce designs which are copies of the communication structures of these organizations”
#microservices@nicolas_frankel 41
ORGANIZATION AT NETFLIX
#microservices@nicolas_frankel 42
THE REAL ISSUE OF MICRO-SERVICES
Makes middle managers unnecessary
#microservices@nicolas_frankel 43
DO YOU THINK…
…anybody would willingly make themselves not necessary?
#microservices@nicolas_frankel 44
BETTER SUITED TO
Small companiesRather flat organizations
#microservices 45@nicolas_frankel
THE LIGHT SIDE
THE DARK SIDE OF MICRO-SERVICES
#microservices@nicolas_frankel 46
AND YET…
#microservices@nicolas_frankel 47
THERE ARE MICRO-SERVICES…
… and web-services• RESTful
#microservices@nicolas_frankel 48
MICRO-SERVICES ENABLERS
HystrixRibbonEurekaFeignEtc.
#microservices@nicolas_frankel 49
FEATURES
Circuit breaker• Fail-fast
FallbackCacheCollapseDashboardAnd many more…
https://github.com/Netflix/Hystrix/wiki/How-To-Use
#microservices@nicolas_frankel 50
CIRCUIT-BREAKER
#microservices@nicolas_frankel 51
FALLBACK
#microservices@nicolas_frankel 52
REQUESTCOLLAPSE
#microservices@nicolas_frankel 53
REQUESTCOLLAPSE
#microservices@nicolas_frankel 54
DASHBOARD
#microservices@nicolas_frankel 55
API FLAVORS
SynchronousAsynchronousReactive
#microservices@nicolas_frankel 56
RIBBON
Client-side load-balancerPluggable rules
#microservices@nicolas_frankel 57
COMMONS RULES
Round robbinAvailability filteringWeighted response time<insert your own there>
#microservices@nicolas_frankel 58
SERVER LIST
Ad hocConfiguration-basedDiscovery enabled• Through Eureka
#microservices@nicolas_frankel 59
EUREKA
Registry for middle tier load balancing• Server• Client
#microservices@nicolas_frankel 60
FEIGN
Annotation based REST client
#microservices@nicolas_frankel 61
SPRING CLOUD*
#microservices 62@nicolas_frankel
SUMMARY
THE DARK SIDE OF MICRO-SERVICES
#microservices@nicolas_frankel 63
ADOPT AN ENGINEER MINDSET
Evaluate benefitsEvaluate costsEvaluate feasibility•Organizational• (Technical)
#microservices 64
Q&A
@nicolas_frankel
http://blog.frankel.ch/@nicolas_frankel http://frankel.in/