Slide 1

Slide 1 text

MODULES INSTEAD OF MICROSERVICES Benjamin Smith @benjamin_smith

Slide 2

Slide 2 text

@benjamin_smith

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

@benjamin_smith

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

MODULES INSTEAD OF MICROSERVICES @benjamin_smith

Slide 9

Slide 9 text

MODULES @benjamin_smith

Slide 10

Slide 10 text

MICROSERVICES @benjamin_smith

Slide 11

Slide 11 text

@benjamin_smith

Slide 12

Slide 12 text

MICROSERVICES @benjamin_smith

Slide 13

Slide 13 text

rails new my_shiny_new_app @benjamin_smith

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

phhhhfff! namespaces? forget about it @benjamin_smith

Slide 16

Slide 16 text

engines @benjamin_smith

Slide 17

Slide 17 text

Rails Engines Ruby Gems Java Modules Node Packages }MODULES

Slide 18

Slide 18 text

MODULES • Self contained • Clearly defined boundaries • Explicit dependencies @benjamin_smith

Slide 19

Slide 19 text

Rails Engines Ruby Gems Java Modules Node Packages }MODULES

Slide 20

Slide 20 text

MODULES • All code lives in the same repo • Modules define the boundaries and dependencies @benjamin_smith

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

@benjamin_smith

Slide 23

Slide 23 text

@benjamin_smith

Slide 24

Slide 24 text

No content

Slide 25

Slide 25 text

No content

Slide 26

Slide 26 text

No content

Slide 27

Slide 27 text

No content

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

MODULES @benjamin_smith

Slide 30

Slide 30 text

MICROSERVICES @benjamin_smith

Slide 31

Slide 31 text

MICROSERVICES • Scaling • Shared data/behavior across apps • Different services requiring different tech stacks • Feeling cool @benjamin_smith

Slide 32

Slide 32 text

your company’s best practices some other company’s best practices != @benjamin_smith

Slide 33

Slide 33 text

MODULES definitely use them @benjamin_smith

Slide 34

Slide 34 text

No content

Slide 35

Slide 35 text

MICROSERVICES • Smaller, easier to manage, codebases • Scalable • Handling large teams @benjamin_smith

Slide 36

Slide 36 text

Smaller, easier to manage, codebases @benjamin_smith

Slide 37

Slide 37 text

No content

Slide 38

Slide 38 text

Features Time @benjamin_smith

Slide 39

Slide 39 text

Features Time @benjamin_smith

Slide 40

Slide 40 text

No content

Slide 41

Slide 41 text

No content

Slide 42

Slide 42 text

@benjamin_smith

Slide 43

Slide 43 text

@benjamin_smith

Slide 44

Slide 44 text

No content

Slide 45

Slide 45 text

No content

Slide 46

Slide 46 text

MODULES @benjamin_smith

Slide 47

Slide 47 text

No content

Slide 48

Slide 48 text

MODULES interfaces and API == functions and methods @benjamin_smith

Slide 49

Slide 49 text

Smaller, easier to manage, codebases @benjamin_smith

Slide 50

Slide 50 text

MODULES • Code • Data • Dependencies • Tests @benjamin_smith

Slide 51

Slide 51 text

No content

Slide 52

Slide 52 text

Features Time @benjamin_smith

Slide 53

Slide 53 text

Scaling @benjamin_smith

Slide 54

Slide 54 text

How to create a service • Step 1: create a module • Step 2: create a service • Step 3: ??? • Step 4: profit @benjamin_smith

Slide 55

Slide 55 text

No content

Slide 56

Slide 56 text

module to microservice class Likes def self.create(…) # create like in DB Like.create!(…) end end class Likes def self.create(…) # make request to Like service Net::HTTP.post_form(…) end end @benjamin_smith

Slide 57

Slide 57 text

No content

Slide 58

Slide 58 text

Handling large teams @benjamin_smith

Slide 59

Slide 59 text

No content

Slide 60

Slide 60 text

MICROSERVICES • Smaller, easier to manage, codebases • Scalable • Handling large teams @benjamin_smith

Slide 61

Slide 61 text

security @benjamin_smith

Slide 62

Slide 62 text

discovery @benjamin_smith

Slide 63

Slide 63 text

centralized logging and debugging @benjamin_smith

Slide 64

Slide 64 text

A centralized logging and debugging @benjamin_smith

Slide 65

Slide 65 text

A centralized logging and debugging B C @benjamin_smith

Slide 66

Slide 66 text

A centralized logging and debugging B C @benjamin_smith

Slide 67

Slide 67 text

API documentation @benjamin_smith

Slide 68

Slide 68 text

performance @benjamin_smith

Slide 69

Slide 69 text

Users Comments

Slide 70

Slide 70 text

Activities Users Comments

Slide 71

Slide 71 text

Activities Users Comments users comments

Slide 72

Slide 72 text

Activities Users Comments create table users create table comments comments users

Slide 73

Slide 73 text

Activities Users Comments create table users create table comments comments users …

Slide 74

Slide 74 text

@benjamin_smith

Slide 75

Slide 75 text

transactions @benjamin_smith

Slide 76

Slide 76 text

testing @benjamin_smith

Slide 77

Slide 77 text

I could go on… @benjamin_smith

Slide 78

Slide 78 text

MODULES INSTEAD OF MICROSERVICES @benjamin_smith

Slide 79

Slide 79 text

Note: modules are hard @benjamin_smith

Slide 80

Slide 80 text

The End? @benjamin_smith

Slide 81

Slide 81 text

MODULES @benjamin_smith

Slide 82

Slide 82 text

MONOLITH INSTEAD OF MODULES @benjamin_smith

Slide 83

Slide 83 text

MONOLITH @benjamin_smith

Slide 84

Slide 84 text

MODULES @benjamin_smith

Slide 85

Slide 85 text

No content

Slide 86

Slide 86 text

No content

Slide 87

Slide 87 text

–Martin Fowler “So my primary guideline would be don't even consider microservices unless you have a system that's too complex to manage as a monolith. The majority of software systems should be built as a single monolithic application. Do pay attention to good modularity within that monolith, but don't try to separate it into separate services.”

Slide 88

Slide 88 text

MONOLITH @benjamin_smith

Slide 89

Slide 89 text

MONOLITH MODULES @benjamin_smith

Slide 90

Slide 90 text

MONOLITH MODULES MICROSERVICES @benjamin_smith

Slide 91

Slide 91 text

Thanks! @benjamin_smith Additional Resources: Rails: cbra.info Java: appcontinuum.io Node: github.com/c9/architect ?

Slide 92

Slide 92 text

Questions? @benjamin_smith Additional Resources: Rails: cbra.info Java: appcontinuum.io Node: github.com/c9/architect ?