Slide 1

Slide 1 text

No content

Slide 2

Slide 2 text

@janogonzalez MICROSERVICES IN PRACTICE

Slide 3

Slide 3 text

LAST YEAR…

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

Leandro “Inkel” López, 2013 “El ordenador, ordena.
 La computadora, computa” ˝

Slide 6

Slide 6 text

12hrs AUDIO/min

Slide 7

Slide 7 text

HUNDREDS OF MILLIONS users/month

Slide 8

Slide 8 text

MANY PLATFORMS

Slide 9

Slide 9 text

$ rails soundcloud

Slide 10

Slide 10 text

The Mothership

Slide 11

Slide 11 text

Pearl Jam - Do the Evolution “It’s evolution, baby!” ˝

Slide 12

Slide 12 text

soundcloud.com iOS/Android 3rd party Public API Domain logic The Mothership

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

WELCOME TO THE MONOLITH Population: you

Slide 15

Slide 15 text

CONWAY’S LAW

Slide 16

Slide 16 text

Marvin Conway, 1968 “Organizations produce systems whose design is a copy of the structure of the organization”


Slide 17

Slide 17 text

BREAKING THE
 MONOLITH ˝

Slide 18

Slide 18 text

MICROSERVICES ARCHITECTURE

Slide 19

Slide 19 text

JUST SOA FOR HIPSTERS?

Slide 20

Slide 20 text

CROSS FUNCTIONAL 
 TEAMS ˝

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

No content

Slide 23

Slide 23 text

BOUNDED
 CONTEXTS ˝

Slide 24

Slide 24 text

Track User Favoriting

Slide 25

Slide 25 text

DOMAIN MODEL 
 FITS IN YOUR HEAD ˝

Slide 26

Slide 26 text

Track Likes Count Favoriting

Slide 27

Slide 27 text

YOU CAN USE 
 THE RIGHT TOOLS ˝

Slide 28

Slide 28 text

FASTERS 
 TESTS ˝

Slide 29

Slide 29 text

ENABLES 
 REPLACEABILITY ˝

Slide 30

Slide 30 text

No content

Slide 31

Slide 31 text

CONTINUOUS 
 DEPLOYMENT ˝

Slide 32

Slide 32 text

SOA WITHOUT VENDOR LOCK-IN?

Slide 33

Slide 33 text

SMART COMPONENTS, 
 DUMB PIPES ˝

Slide 34

Slide 34 text

HC SVNT DRACONES ˝

Slide 35

Slide 35 text

YOU CAN USE 
 TOO MANY TOOLS ˝

Slide 36

Slide 36 text

DUPLICATED 
 EFFORTS ˝

Slide 37

Slide 37 text

AVAILABILITY VS 
 CONSISTENCY ˝

Slide 38

Slide 38 text

CASCADING 
 FAILURES ˝

Slide 39

Slide 39 text

No content

Slide 40

Slide 40 text

No content

Slide 41

Slide 41 text

No content

Slide 42

Slide 42 text

No content

Slide 43

Slide 43 text

TOO MANY 
 NETWORK CALLS ˝

Slide 44

Slide 44 text

No content

Slide 45

Slide 45 text

YOU HAVE 
 NETWORK CALLS ˝

Slide 46

Slide 46 text

L. Peter Deutsch - Ten Fallacies of Distributed Computing “The network is reliable”


Slide 47

Slide 47 text

WHO CALLS WHO AGAIN?

Slide 48

Slide 48 text

OUR MIGRATION TO MICROSERVICES

Slide 49

Slide 49 text

SAY NO TO THE 
 BIG-BANG ˝

Slide 50

Slide 50 text

EXTRACT WHEN 
 MODIFYING ˝

Slide 51

Slide 51 text

Client Apps Public API Domain logic The Mothership Microservice Internal API (bounded context)

Slide 52

Slide 52 text

DE-ACTIVE 
 RECORD ˝

Slide 53

Slide 53 text

def index likes = user_likes_service.public_track_likes( @user, pagination_params) ! respond collection_for(likes) end

Slide 54

Slide 54 text

USE 
 FEATURE FLAGS ˝

Slide 55

Slide 55 text

if $feature.active?(:use_likes_service, current_user) … else … end

Slide 56

Slide 56 text

CREATE 
 YOUR SERVICE ˝

Slide 57

Slide 57 text

MONITOR 
 YOUR SERVICE ˝

Slide 58

Slide 58 text

PREVENT 
 CASCADING FAILURES ˝

Slide 59

Slide 59 text

No content

Slide 60

Slide 60 text

CIRCUIT BREAKERS ˝

Slide 61

Slide 61 text

No content

Slide 62

Slide 62 text

X X X

Slide 63

Slide 63 text

X X X

Slide 64

Slide 64 text

X X

Slide 65

Slide 65 text

USE LIFECYCLE 
 EVENTS ˝

Slide 66

Slide 66 text

Public API Domain logic The Mothership Microservice Internal API Events Broker

Slide 67

Slide 67 text

EVENTUAL 
 CONSISTENCY ˝

Slide 68

Slide 68 text

Microservice Microservice Client b1:(p,q,r), b2:(/) (a1;b1),(a1;b2)

Slide 69

Slide 69 text

DEFINE AUTHORITATIVE 
 SOURCES ˝

Slide 70

Slide 70 text

DEFINE SYSTEM 
 ROLES ˝

Slide 71

Slide 71 text

Microservice Microservice Client b1:(p,q,r), b2:(/) (a1;b1),(a1;b2)

Slide 72

Slide 72 text

Listing system Entity System Client b1:(p,q,r), b2:(/) (a1;b1),(a1;b2)

Slide 73

Slide 73 text

REDUCE 
 “CHATTINESS” ˝

Slide 74

Slide 74 text

ONE SIZE 
 DOESN’T FIT ALL ˝

Slide 75

Slide 75 text

CLIENT SPECIFIC 
 APIs ˝

Slide 76

Slide 76 text

BFF ˝

Slide 77

Slide 77 text

Listing system Entity System Entity System Client specific API

Slide 78

Slide 78 text

Listing system Entity System Entity System Client specific API (a1;b1),(a1;b2)

Slide 79

Slide 79 text

Listing system Entity System Entity System Client specific API a1:(x,y,z) b1:(p,q,r), b2:(/)

Slide 80

Slide 80 text

Listing system Entity System Entity System Client specific API (a1.x, a1.y, b1.p)

Slide 81

Slide 81 text

EXTRACTING 
 LIBRARIES ˝

Slide 82

Slide 82 text

COMING SOON…

Slide 83

Slide 83 text

DISTRIBUTED 
 TRACING ˝

Slide 84

Slide 84 text

MORE TOLERANT 
 READERS ˝

Slide 85

Slide 85 text

BINARY 
 PROTOCOLS? ˝

Slide 86

Slide 86 text

CONCLUSIONS

Slide 87

Slide 87 text

SMALL FOCUSED
 TEAMS ˝

Slide 88

Slide 88 text

DELIVERING
 FAST ˝

Slide 89

Slide 89 text

BEWARE OF
 LOSING THE BIG PICTURE ˝

Slide 90

Slide 90 text

BEWARE OF
 TOO MANY STACKS ˝

Slide 91

Slide 91 text

BEWARE OF
 DUPLICATE EFFORTS ˝

Slide 92

Slide 92 text

AVOID
 BIG-BANG MIGRATIONS ˝

Slide 93

Slide 93 text

EXPECT
 DISTRIBUTED FAILURE ˝

Slide 94

Slide 94 text

MONITOR
 ALL THE SERVICES ˝

Slide 95

Slide 95 text

MICROSERVICES WORK
 FOR US, BUT…

Slide 96

Slide 96 text

NO SILVER BULLET ˝

Slide 97

Slide 97 text

THANK YOU [email protected] http://soundcloud.com/jobs

Slide 98

Slide 98 text

(WE ARE HIRING) [email protected] http://soundcloud.com/jobs

Slide 99

Slide 99 text

•https://www.flickr.com/photos/rubyconfar/11231906253/in/set-72157638113568114
 •"Gilbert Hill, Andheri" by Madhav Pai - originally posted to Flickr as Gilbert Hill, Andheri. Licensed under Creative Commons Attribution 2.0 via Wikimedia Commons - http://commons.wikimedia.org/wiki/ File:Gilbert_Hill,_Andheri.jpg#mediaviewer/File:Gilbert_Hill,_Andheri.jpg