Slide 1

Slide 1 text

HOW TO DISASSEMBLE A MONOLITHIC APP IN (NOT-SO)MICRO-SERVICES Turin - 17 november 2015

Slide 2

Slide 2 text

MICHELE FRANZIN @REALFUZZY

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

PARTNERS

Slide 5

Slide 5 text

8000 TRANSACTIONS/MONTH in just an hour

Slide 6

Slide 6 text

DISCLAIMER ̣my personal opinion ̣people have different experiences ̣ideas, comment, etc contact me @realfuzzy ̣subject is wide, so I’d love to hear your thoughts :-) ̣It’s not a code talk (but I’ll show you some code)

Slide 7

Slide 7 text

AGENDA: THERE’S NO AGENDA I’ve got a tale instead

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

BUAHAHAHAHA! I AM THE MONOLITH! COME TO THE WORLD TO BRING IMMOBILISM AND COMPLEXITY!

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

MONOLITHIC MICROSERVICE architecture is the keyword ARCHITECTURE ARCHITECTURE

Slide 15

Slide 15 text

THE MONOLITH

Slide 16

Slide 16 text

THE (SOMETIMES EVIL) MONOLITH http://www.infoq.com/articles/microservices-intro

Slide 17

Slide 17 text

✓simple to develop ✓IDEs & development tools support ✓easy to test ✓simple to deploy ✓works well for relatively small apps

Slide 18

Slide 18 text

- growth overloads everything - difficult to adopt new technologies - often stuck with the starting choices - doesn’t scale to long-lived-application

Slide 19

Slide 19 text

#MICROSERVICE SEARCH TREND

Slide 20

Slide 20 text

WHAT’S A MICROSERVICE • suite of small services • running in its own process • communicating with lightweight mechanisms • built around business capabilities • independently automated deployable • minimum of centralized management • technology agnostic

Slide 21

Slide 21 text

http://blog.arungupta.me/monolithic-microservices-refactoring-javaee-applications/

Slide 22

Slide 22 text

✓each microservice is relatively small ✓easier for a developer to understand ✓easier to scale development ✓improve fault isolation ✓develop and deploy independently ✓no long-term commitment to a tech-stack ✓allow a fine-grained performance tuning or scaling

Slide 23

Slide 23 text

- additional complexity of a distributed system - tools/IDEs are monolithic applications oriented - testing is more difficult - must implement the inter-service communication - increase memory consumption

Slide 24

Slide 24 text

THE NEW BEGINNING https://upload.wikimedia.org/wikipedia/commons/6/67/Change_In_Hand.jpg

Slide 25

Slide 25 text

GOALS ‣ time ‣ budget ‣ shit (can) happens ‣ ship

Slide 26

Slide 26 text

AGENDA* ✓ what’s a microservice? • why have I to jump in ? • where I can start from ? • how I should be aware of ? * I know, I know, I lied about the agenda

Slide 27

Slide 27 text

No content

Slide 28

Slide 28 text

Sir. Tools A warrior that can use every kind of tool as a weapon Strateky Sensei Master renowned for its strategic and tactical ability Workodoo Master The work-force is strong with this one

Slide 29

Slide 29 text

No content

Slide 30

Slide 30 text

No content

Slide 31

Slide 31 text

HAHAHAHA! YOUR EFFORTS ARE NOT ENOUGH TO DEFEAT ME!

Slide 32

Slide 32 text

No content

Slide 33

Slide 33 text

Your efforts have little effect! an orthogonal approach might help you ...

Slide 34

Slide 34 text

No content

Slide 35

Slide 35 text

Q0: HOW TO DECOMPOSE A MONOLITH? 1. Identify business boundaries 2. start decomposing each into own microservice 3. follow the Single Responsibility Principle 4. goto :2

Slide 36

Slide 36 text

…MANY SERVICES THAT COMMUNICATE ? http://www.raptorsrepublic.com/

Slide 37

Slide 37 text

ASYNC MESSAGING X P S2 S1

Slide 38

Slide 38 text

CHOOSE WISELY • Reliability • Routing algorithms • Highly Availability • Supported protocols

Slide 39

Slide 39 text

MESSAGE BUS X P1 S2 S1 P2 S3

Slide 40

Slide 40 text

OUR CHOICE ☛ RABBITMQ • AMPQ message broker • Erlang • Fast, reliable, secure • Many clients • Commercial support

Slide 41

Slide 41 text

SPECIFICATION IS A MUST HAVE (no matter what)

Slide 42

Slide 42 text

DESIGN FOR FAILURE aka: communicate when communication is hard

Slide 43

Slide 43 text

CIRCUIT BREAKER https://www.flickr.com/photos/leafbug/409950515/

Slide 44

Slide 44 text

http://martinfowler.com/bliki/CircuitBreaker.html

Slide 45

Slide 45 text

SLIM FIT circuit_breaker https://github.com/ wsargent/circuit_breaker breaker_box https://github.com/ sittercity/breaker_box CB2 https://github.com/pedro/cb2 S M L

Slide 46

Slide 46 text

STOPLIGHT https://github.com/orgsync/stoplight

Slide 47

Slide 47 text

–Giovanni Mela “Inserisci qui una citazione”. 9XL

Slide 48

Slide 48 text

– Martin Fowler, Chief Scientist - ThoughtWorks “…don’t even consider microservices unless you have a system that's too complex to manage as a monolith”

Slide 49

Slide 49 text

YAGNI do monolith first monolith microservice complexity productivity http://martinfowler.com/bliki/MicroservicePremium.html

Slide 50

Slide 50 text

CONTINUOUS DEPLOYMENT FOR RUBY GEMS

Slide 51

Slide 51 text

No content

Slide 52

Slide 52 text

No content

Slide 53

Slide 53 text

No content

Slide 54

Slide 54 text

–Giovanni Mela “Inserisci qui una citazione”.

Slide 55

Slide 55 text

No content

Slide 56

Slide 56 text

No content

Slide 57

Slide 57 text

No content

Slide 58

Slide 58 text

– Melvin Conway, 1968 “organizations which design systems … are constrained to produce designs which are copies of the communication structures of these organizations”

Slide 59

Slide 59 text

THE INVERSE CONWAY MANEUVER

Slide 60

Slide 60 text

– Martin Fowler, Chief Scientist - ThoughtWorks “For many people throwing away a code base is a sign of failure, perhaps understandable …, but still failure.”

Slide 61

Slide 61 text

SACRIFICIAL ARCHITECTURE http://www.cardhub.com/edu/credit-cards-expiration-date

Slide 62

Slide 62 text

POLYGLOT IS NICE but mother tongue is fair enough

Slide 63

Slide 63 text

DEVOPS! no devops?!? no party. https://www.flickr.com/photos/91657289@N02/10218392744

Slide 64

Slide 64 text

The Smith Master craftsman expert in forging anything The Sculptor An artist able to give shape to magnificent works The Painter Colors and shapes come to life on her canvas!

Slide 65

Slide 65 text

No content

Slide 66

Slide 66 text

No content

Slide 67

Slide 67 text

No content

Slide 68

Slide 68 text

No content

Slide 69

Slide 69 text

No content

Slide 70

Slide 70 text

No content

Slide 71

Slide 71 text

No content

Slide 72

Slide 72 text

NO MONOLITHS WERE HARMED IN THE MAKING OF THIS PRESENTATION

Slide 73

Slide 73 text

[email protected] @BriguGraphic Illustrated by:

Slide 74

Slide 74 text

TAKEAWAYS • go monolith first • communication (all-around) is strategic assets • start simple, don’t fear the change • take decisions. I-really-mean-that.

Slide 75

Slide 75 text

…WHAT’S NEXT ? • testing • CQRS + ES • log analisys & monitoring • metrics • …

Slide 76

Slide 76 text

Thank you. @realfuzzy Michele Franzin