devexperience - the dark side of microservices

63
THE DARK SIDE OF MICRO- SERVICES @NICOLAS_FRANKEL

Upload: nicolas-frankel

Post on 06-Apr-2017

170 views

Category:

Software


0 download

TRANSCRIPT

Page 1: DevExperience - The Dark Side of Microservices

THE DARK SIDE OF MICRO-SERVICES@NICOLAS_FRANKEL

Page 2: DevExperience - The Dark Side of Microservices

#microservices 2

ME, MYSELF AND I

@nicolas_frankel

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

Page 3: DevExperience - The Dark Side of Microservices

#microservices@nicolas_frankel #springboot 3

HYBRIS, AN SAP COMPANY

Page 4: DevExperience - The Dark Side of Microservices

#microservices@nicolas_frankel 4

MICRO-SERVICES ON PAPER

Page 5: DevExperience - The Dark Side of Microservices

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

Page 6: DevExperience - The Dark Side of Microservices

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

Page 7: DevExperience - The Dark Side of Microservices

#microservices@nicolas_frankel 7

MICRO-SERVICES IN REAL LIFE

Page 8: DevExperience - The Dark Side of Microservices

#microservices@nicolas_frankel 8

SUMMARY

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

Page 9: DevExperience - The Dark Side of Microservices

#microservices 9@nicolas_frankel

A TENTATIVE DEFINITION

THE DARK SIDE OF MICRO-SERVICES

Page 10: DevExperience - The Dark Side of Microservices

#microservices@nicolas_frankel 10

THE MONOLITH

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

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

Page 11: DevExperience - The Dark Side of Microservices

#microservices@nicolas_frankel 11

SCALING A MONOLITH

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

Page 12: DevExperience - The Dark Side of Microservices

#microservices@nicolas_frankel 12

ASSUMPTION

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

Page 13: DevExperience - The Dark Side of Microservices

#microservices@nicolas_frankel 13

EXAMPLE: E-COMMERCE SHOP

CatalogCartLoginPaymentetc.

Page 14: DevExperience - The Dark Side of Microservices

#microservices@nicolas_frankel 14

MICRO-SERVICES

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

Page 15: DevExperience - The Dark Side of Microservices

#microservices@nicolas_frankel 15

SCALING MICRO-SERVICES

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

Page 16: DevExperience - The Dark Side of Microservices

#microservices@nicolas_frankel 16

SINGLE RESPONSIBILITY PRINCIPLE

Component-based Wrapping a single business

capability• Fine-grained

Decoupled from one another

Communicating via simple channels

Page 17: DevExperience - The Dark Side of Microservices

#microservices 17@nicolas_frankel

BENEFITS

THE DARK SIDE OF MICRO-SERVICES

Page 18: DevExperience - The Dark Side of Microservices

#microservices@nicolas_frankel 18

DIFFERENTIAL SCALING

Optimizing resources

Page 19: DevExperience - The Dark Side of Microservices

#microservices@nicolas_frankel 19

DECOUPLED LIFECYCLES

Enable continuous delivery•No more release trains!

Page 20: DevExperience - The Dark Side of Microservices

#microservices@nicolas_frankel 20

CONTINUOUS/EVOLUTIONARY DESIGN

No necessary fixed upfront design•Allows for continuous changes

Page 21: DevExperience - The Dark Side of Microservices

#microservices@nicolas_frankel 21

POLYGLOT PERSISTENCE

Choose the best persistence tier for the job

Page 22: DevExperience - The Dark Side of Microservices

#microservices@nicolas_frankel 22

POLYGLOT

Choose the best language for the job

Page 23: DevExperience - The Dark Side of Microservices

#microservices@nicolas_frankel 23

THE FIRST AND FOREMOST BENEFIT

Scaling your development team!

Page 24: DevExperience - The Dark Side of Microservices

#microservices 24@nicolas_frankel

REQUIREMENTS

THE DARK SIDE OF MICRO-SERVICES

Page 25: DevExperience - The Dark Side of Microservices

#microservices@nicolas_frankel 25

INFRASTRUCTURE AUTOMATION

To deliver continuously

Page 26: DevExperience - The Dark Side of Microservices

#microservices@nicolas_frankel 26

FORMALIZED DOCUMENTATION

To help service users

Page 27: DevExperience - The Dark Side of Microservices

#microservices@nicolas_frankel 27

MONITORING

Cross-components

Page 28: DevExperience - The Dark Side of Microservices

#microservices 29@nicolas_frankel

CORE ISSUES

THE DARK SIDE OF MICRO-SERVICES

Page 29: DevExperience - The Dark Side of Microservices

#microservices@nicolas_frankel 30

Page 30: DevExperience - The Dark Side of Microservices

#microservices@nicolas_frankel 31

THE NETWORK!

From a simple API call to a network call…

Page 31: DevExperience - The Dark Side of Microservices

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

Page 32: DevExperience - The Dark Side of Microservices

#microservices@nicolas_frankel 33

NEW PROBLEMS ARISE

Latency•Asynchronicity• Performance drop

Page 33: DevExperience - The Dark Side of Microservices

#microservices@nicolas_frankel 34

NEW PROBLEMS ARISE

Handling failures•Different handling•Unavailable service

Page 34: DevExperience - The Dark Side of Microservices

#microservices@nicolas_frankel 35

NEW PROBLEMS ARISE

Serialization/deserialization• Performance drop

Page 35: DevExperience - The Dark Side of Microservices

#microservices@nicolas_frankel 36

STRIKE A BALANCE

Between scalability and performance

Page 36: DevExperience - The Dark Side of Microservices

#microservices@nicolas_frankel 37

NOT ONLY TECHNICAL ISSUES

Page 37: DevExperience - The Dark Side of Microservices

#microservices@nicolas_frankel 38

AGILE?

Trying to do agileDoing agileBeing agile

Page 38: DevExperience - The Dark Side of Microservices

#microservices@nicolas_frankel 39

ORGANIZING TEAMS

Limited size• Fed by 2 pizzas

AutonomousSelf-organizing

Page 39: DevExperience - The Dark Side of Microservices

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

Page 40: DevExperience - The Dark Side of Microservices

#microservices@nicolas_frankel 41

ORGANIZATION AT NETFLIX

Page 41: DevExperience - The Dark Side of Microservices

#microservices@nicolas_frankel 42

THE REAL ISSUE OF MICRO-SERVICES

Makes middle managers unnecessary

Page 42: DevExperience - The Dark Side of Microservices

#microservices@nicolas_frankel 43

DO YOU THINK…

…anybody would willingly make themselves not necessary?

Page 43: DevExperience - The Dark Side of Microservices

#microservices@nicolas_frankel 44

BETTER SUITED TO

Small companiesRather flat organizations

Page 44: DevExperience - The Dark Side of Microservices

#microservices 45@nicolas_frankel

THE LIGHT SIDE

THE DARK SIDE OF MICRO-SERVICES

Page 45: DevExperience - The Dark Side of Microservices

#microservices@nicolas_frankel 46

AND YET…

Page 46: DevExperience - The Dark Side of Microservices

#microservices@nicolas_frankel 47

THERE ARE MICRO-SERVICES…

… and web-services• RESTful

Page 47: DevExperience - The Dark Side of Microservices

#microservices@nicolas_frankel 48

MICRO-SERVICES ENABLERS

HystrixRibbonEurekaFeignEtc.

Page 48: DevExperience - The Dark Side of Microservices

#microservices@nicolas_frankel 49

FEATURES

Circuit breaker• Fail-fast

FallbackCacheCollapseDashboardAnd many more…

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

Page 49: DevExperience - The Dark Side of Microservices

#microservices@nicolas_frankel 50

CIRCUIT-BREAKER

Page 50: DevExperience - The Dark Side of Microservices

#microservices@nicolas_frankel 51

FALLBACK

Page 51: DevExperience - The Dark Side of Microservices

#microservices@nicolas_frankel 52

REQUESTCOLLAPSE

Page 52: DevExperience - The Dark Side of Microservices

#microservices@nicolas_frankel 53

REQUESTCOLLAPSE

Page 53: DevExperience - The Dark Side of Microservices

#microservices@nicolas_frankel 54

DASHBOARD

Page 54: DevExperience - The Dark Side of Microservices

#microservices@nicolas_frankel 55

API FLAVORS

SynchronousAsynchronousReactive

Page 55: DevExperience - The Dark Side of Microservices

#microservices@nicolas_frankel 56

RIBBON

Client-side load-balancerPluggable rules

Page 56: DevExperience - The Dark Side of Microservices

#microservices@nicolas_frankel 57

COMMONS RULES

Round robbinAvailability filteringWeighted response time<insert your own there>

Page 57: DevExperience - The Dark Side of Microservices

#microservices@nicolas_frankel 58

SERVER LIST

Ad hocConfiguration-basedDiscovery enabled• Through Eureka

Page 58: DevExperience - The Dark Side of Microservices

#microservices@nicolas_frankel 59

EUREKA

Registry for middle tier load balancing• Server• Client

Page 59: DevExperience - The Dark Side of Microservices

#microservices@nicolas_frankel 60

FEIGN

Annotation based REST client

Page 60: DevExperience - The Dark Side of Microservices

#microservices@nicolas_frankel 61

SPRING CLOUD*

Page 61: DevExperience - The Dark Side of Microservices

#microservices 62@nicolas_frankel

SUMMARY

THE DARK SIDE OF MICRO-SERVICES

Page 62: DevExperience - The Dark Side of Microservices

#microservices@nicolas_frankel 63

ADOPT AN ENGINEER MINDSET

Evaluate benefitsEvaluate costsEvaluate feasibility•Organizational• (Technical)

Page 63: DevExperience - The Dark Side of Microservices

#microservices 64

Q&A

@nicolas_frankel

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