Upload
nicolas-frankel
View
1.130
Download
2
Embed Size (px)
Citation preview
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 3
MICRO-SERVICES ON PAPER
#microservices@nicolas_frankel 4
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 5
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 6
MICRO-SERVICES IN REAL LIFE
#microservices@nicolas_frankel 7
SUMMARY
What are micro-services?What benefits to expect?What requirements?What’s in it for you now?
#microservices 8@nicolas_frankel
A TENTATIVE DEFINITION
THE DARK SIDE OF MICRO-SERVICES
#microservices@nicolas_frankel 9
THE MONOLITH
“A monolithic application puts all its functionality into a single process…”
http://martinfowler.com/articles/microservices.html
#microservices@nicolas_frankel 10
SCALING A MONOLITH
“… and scales by replicating the monolith on different servers”
#microservices@nicolas_frankel 11
ASSUMPTION
All functionalities of your application have the same load• Really?
#microservices@nicolas_frankel 12
EXAMPLE: E-COMMERCE SHOP
CatalogCartLoginPaymentetc.
#microservices@nicolas_frankel 13
MICRO-SERVICES
“A microservices architecture puts each element of functionality into a separate service…”
#microservices@nicolas_frankel 14
SCALING MICRO-SERVICES
“… and scales by distributing these services across servers, scaling as needed”
#microservices@nicolas_frankel 15
SINGLE RESPONSIBILITY PRINCIPLE
Component-based Wrapping a single business
capability• Fine-grained
Decoupled from one another
Communicating via simple channels
#microservices 16@nicolas_frankel
BENEFITS
THE DARK SIDE OF MICRO-SERVICES
#microservices@nicolas_frankel 17
DIFFERENTIAL SCALING
Optimizing resources
#microservices@nicolas_frankel 18
DECOUPLED LIFECYCLES
Enable continuous delivery•No more release trains!
#microservices@nicolas_frankel 19
CONTINUOUS/EVOLUTIONARY DESIGN
No necessary fixed upfront design•Allows for continuous changes
#microservices@nicolas_frankel 20
POLYGLOT PERSISTENCE
Choose the best persistence tier for the job
#microservices@nicolas_frankel 21
POLYGLOT
Choose the best language for the job
#microservices 22@nicolas_frankel
REQUIREMENTS
THE DARK SIDE OF MICRO-SERVICES
#microservices@nicolas_frankel 23
INFRASTRUCTURE AUTOMATION
To deliver continuously
#microservices@nicolas_frankel 24
FORMALIZED DOCUMENTATION
To help service users
#microservices@nicolas_frankel 25
MONITORING
Cross-components
#microservices 27@nicolas_frankel
CORE ISSUES
THE DARK SIDE OF MICRO-SERVICES
#microservices@nicolas_frankel 28
#microservices@nicolas_frankel 29
THE NETWORK!
From a simple API call to a network call…
#microservices@nicolas_frankel 30
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 31
NEW PROBLEMS ARISE
Latency•Asynchronicity• Performance drop
#microservices@nicolas_frankel 32
NEW PROBLEMS ARISE
Handling failures•Different handling•Unavailable service
#microservices@nicolas_frankel 33
NEW PROBLEMS ARISE
Serialization/deserialization• Performance drop
#microservices@nicolas_frankel 34
STRIKE A BALANCE
Between scalability and performance
#microservices@nicolas_frankel 35
NOT ONLY TECHNICAL ISSUES
#microservices@nicolas_frankel 36
AGILE?
Trying to do agileDoing agileBeing agile
#microservices@nicolas_frankel 37
ORGANIZING TEAMS
Limited size• Fed by 2 pizzas
AutonomousSelf-organizing
#microservices@nicolas_frankel 38
ORGANIZATION AT NETFLIX
#microservices@nicolas_frankel 39
THE BANE OF MIDDLE MANAGEMENT
Most middle managers are useless• But they want to keep their jobs
Better suited to• Small companies• Rather flat organizations
#microservices 40@nicolas_frankel
THE LIGHT SIDE
THE DARK SIDE OF MICRO-SERVICES
#microservices@nicolas_frankel 41
AND YET…
#microservices@nicolas_frankel 42
THERE ARE MICRO-SERVICES…
… and web-services• RESTful
#microservices@nicolas_frankel 43
MICRO-SERVICES ENABLERS
HystrixRibbonEurekaFeign
#microservices@nicolas_frankel 44
FEATURES
Circuit breaker• Fail-fast
FallbackCacheCollapseDashboardAnd many more…
https://github.com/Netflix/Hystrix/wiki/How-To-Use
#microservices@nicolas_frankel 45
CIRCUIT-BREAKER
#microservices@nicolas_frankel 46
FALLBACK
#microservices@nicolas_frankel 47
REQUESTCOLLAPSE
#microservices@nicolas_frankel 48
REQUESTCOLLAPSE
#microservices@nicolas_frankel 49
DASHBOARD
#microservices@nicolas_frankel 50
API FLAVORS
SynchronousAsynchronousReactive
#microservices@nicolas_frankel 51
RIBBON
Client-side load-balancerPluggable rules
#microservices@nicolas_frankel 52
COMMONS RULES
Round robbinAvailability filteringWeighted response time<insert your own there>
#microservices@nicolas_frankel 53
SERVER LIST
Ad hocConfiguration-basedDiscovery enabled• Through Eureka
#microservices@nicolas_frankel 54
EUREKA
Registry for middle tier load balancing• Server• Client
#microservices@nicolas_frankel 55
FEIGN
Annotation based REST client
#microservices@nicolas_frankel 56
SPRING CLOUD*
#microservices 57@nicolas_frankel
SUMMARY
THE DARK SIDE OF MICRO-SERVICES
#microservices@nicolas_frankel 58
ADOPT AN ENGINEER MINDSET
Evaluate benefitsEvaluate costsEvaluate feasibility• Technical•Organizational
#microservices 59
Q&A
@nicolas_frankel
http://blog.frankel.ch/@nicolas_frankel http://frankel.in/