58
THE DARK SIDE OF MICRO- SERVICES @NICOLAS_FRANKEL

The Dark Side of Microservices

Embed Size (px)

Citation preview

Page 1: The Dark Side of Microservices

THE DARK SIDE OF MICRO-SERVICES@NICOLAS_FRANKEL

Page 2: The Dark Side of Microservices

#microservices 2

ME, MYSELF AND I

@nicolas_frankel

Developer/Software -/Solution Architect• Java• As consultant

Page 3: The Dark Side of Microservices

#microservices@nicolas_frankel 3

MICRO-SERVICES ON PAPER

Page 4: The Dark Side of Microservices

#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/

Page 5: The Dark Side of Microservices

#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/

Page 6: The Dark Side of Microservices

#microservices@nicolas_frankel 6

MICRO-SERVICES IN REAL LIFE

Page 7: The Dark Side of Microservices

#microservices@nicolas_frankel 7

SUMMARY

What are micro-services?What benefits to expect?What requirements?What’s in it for you now?

Page 8: The Dark Side of Microservices

#microservices 8@nicolas_frankel

A TENTATIVE DEFINITION

THE DARK SIDE OF MICRO-SERVICES

Page 9: The Dark Side of Microservices

#microservices@nicolas_frankel 9

THE MONOLITH

“A monolithic application puts all its functionality into a single process…”

http://martinfowler.com/articles/microservices.html

Page 10: The Dark Side of Microservices

#microservices@nicolas_frankel 10

SCALING A MONOLITH

“… and scales by replicating the monolith on different servers”

Page 11: The Dark Side of Microservices

#microservices@nicolas_frankel 11

ASSUMPTION

All functionalities of your application have the same load• Really?

Page 12: The Dark Side of Microservices

#microservices@nicolas_frankel 12

EXAMPLE: E-COMMERCE SHOP

CatalogCartLoginPaymentetc.

Page 13: The Dark Side of Microservices

#microservices@nicolas_frankel 13

MICRO-SERVICES

“A microservices architecture puts each element of functionality into a separate service…”

Page 14: The Dark Side of Microservices

#microservices@nicolas_frankel 14

SCALING MICRO-SERVICES

“… and scales by distributing these services across servers, scaling as needed”

Page 15: The Dark Side of Microservices

#microservices@nicolas_frankel 15

SINGLE RESPONSIBILITY PRINCIPLE

Component-based Wrapping a single business

capability• Fine-grained

Decoupled from one another

Communicating via simple channels

Page 16: The Dark Side of Microservices

#microservices 16@nicolas_frankel

BENEFITS

THE DARK SIDE OF MICRO-SERVICES

Page 17: The Dark Side of Microservices

#microservices@nicolas_frankel 17

DIFFERENTIAL SCALING

Optimizing resources

Page 18: The Dark Side of Microservices

#microservices@nicolas_frankel 18

DECOUPLED LIFECYCLES

Enable continuous delivery•No more release trains!

Page 19: The Dark Side of Microservices

#microservices@nicolas_frankel 19

CONTINUOUS/EVOLUTIONARY DESIGN

No necessary fixed upfront design•Allows for continuous changes

Page 20: The Dark Side of Microservices

#microservices@nicolas_frankel 20

POLYGLOT PERSISTENCE

Choose the best persistence tier for the job

Page 21: The Dark Side of Microservices

#microservices@nicolas_frankel 21

POLYGLOT

Choose the best language for the job

Page 22: The Dark Side of Microservices

#microservices 22@nicolas_frankel

REQUIREMENTS

THE DARK SIDE OF MICRO-SERVICES

Page 23: The Dark Side of Microservices

#microservices@nicolas_frankel 23

INFRASTRUCTURE AUTOMATION

To deliver continuously

Page 24: The Dark Side of Microservices

#microservices@nicolas_frankel 24

FORMALIZED DOCUMENTATION

To help service users

Page 25: The Dark Side of Microservices

#microservices@nicolas_frankel 25

MONITORING

Cross-components

Page 26: The Dark Side of Microservices

#microservices 27@nicolas_frankel

CORE ISSUES

THE DARK SIDE OF MICRO-SERVICES

Page 27: The Dark Side of Microservices

#microservices@nicolas_frankel 28

Page 28: The Dark Side of Microservices

#microservices@nicolas_frankel 29

THE NETWORK!

From a simple API call to a network call…

Page 29: The Dark Side of Microservices

#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.

Page 30: The Dark Side of Microservices

#microservices@nicolas_frankel 31

NEW PROBLEMS ARISE

Latency•Asynchronicity• Performance drop

Page 31: The Dark Side of Microservices

#microservices@nicolas_frankel 32

NEW PROBLEMS ARISE

Handling failures•Different handling•Unavailable service

Page 32: The Dark Side of Microservices

#microservices@nicolas_frankel 33

NEW PROBLEMS ARISE

Serialization/deserialization• Performance drop

Page 33: The Dark Side of Microservices

#microservices@nicolas_frankel 34

STRIKE A BALANCE

Between scalability and performance

Page 34: The Dark Side of Microservices

#microservices@nicolas_frankel 35

NOT ONLY TECHNICAL ISSUES

Page 35: The Dark Side of Microservices

#microservices@nicolas_frankel 36

AGILE?

Trying to do agileDoing agileBeing agile

Page 36: The Dark Side of Microservices

#microservices@nicolas_frankel 37

ORGANIZING TEAMS

Limited size• Fed by 2 pizzas

AutonomousSelf-organizing

Page 37: The Dark Side of Microservices

#microservices@nicolas_frankel 38

ORGANIZATION AT NETFLIX

Page 38: The Dark Side of Microservices

#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

Page 39: The Dark Side of Microservices

#microservices 40@nicolas_frankel

THE LIGHT SIDE

THE DARK SIDE OF MICRO-SERVICES

Page 40: The Dark Side of Microservices

#microservices@nicolas_frankel 41

AND YET…

Page 41: The Dark Side of Microservices

#microservices@nicolas_frankel 42

THERE ARE MICRO-SERVICES…

… and web-services• RESTful

Page 42: The Dark Side of Microservices

#microservices@nicolas_frankel 43

MICRO-SERVICES ENABLERS

HystrixRibbonEurekaFeign

Page 43: The Dark Side of Microservices

#microservices@nicolas_frankel 44

FEATURES

Circuit breaker• Fail-fast

FallbackCacheCollapseDashboardAnd many more…

https://github.com/Netflix/Hystrix/wiki/How-To-Use

Page 44: The Dark Side of Microservices

#microservices@nicolas_frankel 45

CIRCUIT-BREAKER

Page 45: The Dark Side of Microservices

#microservices@nicolas_frankel 46

FALLBACK

Page 46: The Dark Side of Microservices

#microservices@nicolas_frankel 47

REQUESTCOLLAPSE

Page 47: The Dark Side of Microservices

#microservices@nicolas_frankel 48

REQUESTCOLLAPSE

Page 48: The Dark Side of Microservices

#microservices@nicolas_frankel 49

DASHBOARD

Page 49: The Dark Side of Microservices

#microservices@nicolas_frankel 50

API FLAVORS

SynchronousAsynchronousReactive

Page 50: The Dark Side of Microservices

#microservices@nicolas_frankel 51

RIBBON

Client-side load-balancerPluggable rules

Page 51: The Dark Side of Microservices

#microservices@nicolas_frankel 52

COMMONS RULES

Round robbinAvailability filteringWeighted response time<insert your own there>

Page 52: The Dark Side of Microservices

#microservices@nicolas_frankel 53

SERVER LIST

Ad hocConfiguration-basedDiscovery enabled• Through Eureka

Page 53: The Dark Side of Microservices

#microservices@nicolas_frankel 54

EUREKA

Registry for middle tier load balancing• Server• Client

Page 54: The Dark Side of Microservices

#microservices@nicolas_frankel 55

FEIGN

Annotation based REST client

Page 55: The Dark Side of Microservices

#microservices@nicolas_frankel 56

SPRING CLOUD*

Page 56: The Dark Side of Microservices

#microservices 57@nicolas_frankel

SUMMARY

THE DARK SIDE OF MICRO-SERVICES

Page 57: The Dark Side of Microservices

#microservices@nicolas_frankel 58

ADOPT AN ENGINEER MINDSET

Evaluate benefitsEvaluate costsEvaluate feasibility• Technical•Organizational

Page 58: The Dark Side of Microservices

#microservices 59

Q&A

@nicolas_frankel

http://blog.frankel.ch/@nicolas_frankel http://frankel.in/