Slide 1

Slide 1 text

Building Microservice Architectures with Go Matt Heath, Mondo #yow2015

Slide 2

Slide 2 text

@mattheath

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

1895

Slide 6

Slide 6 text

monoliths traditional dev

Slide 7

Slide 7 text

No content

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

No content

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

?

Slide 17

Slide 17 text

DATABASE APPLICATION

Slide 18

Slide 18 text

DATABASE APPLICATION

Slide 19

Slide 19 text

DATABASE DATABASES APPLICATION

Slide 20

Slide 20 text

DATABASE DATABASES APPLICATION SEARCH

Slide 21

Slide 21 text

DATABASE DATABASES APPLICATION CACHE SEARCH

Slide 22

Slide 22 text

DATABASE DATABASES APPLICATION CACHE SEARCH CAT GIFS

Slide 23

Slide 23 text

ALL HAIL THE MONOLITH

Slide 24

Slide 24 text

DO NOT WANT

Slide 25

Slide 25 text

DATABASE DATABASES APPLICATION CACHE SEARCH CAT GIFS

Slide 26

Slide 26 text

APPLICATION

Slide 27

Slide 27 text

No content

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

Why Microservices at Mondo?

Slide 30

Slide 30 text

Single Responsibility Principle

Slide 31

Slide 31 text

Bounded Context

Slide 32

Slide 32 text

Well defined Interfaces

Slide 33

Slide 33 text

Composability

Slide 34

Slide 34 text

Why not start with Microservices?

Slide 35

Slide 35 text

LOAD BALANCER

Slide 36

Slide 36 text

LOAD BALANCER HTTP API & ROUTING LAYER

Slide 37

Slide 37 text

TRANSPORT LOAD BALANCER HTTP API & ROUTING LAYER

Slide 38

Slide 38 text

SERVICE SERVICE SERVICE TRANSPORT LOAD BALANCER HTTP API & ROUTING LAYER

Slide 39

Slide 39 text

SERVICE SERVICE SERVICE TRANSPORT DATABASE DATABASE DATABASE LOAD BALANCER HTTP API & ROUTING LAYER

Slide 40

Slide 40 text

SERVICE SERVICE SERVICE TRANSPORT DATABASE DATABASE DATABASE LOAD BALANCER DATACENTRE n HTTP API & ROUTING LAYER

Slide 41

Slide 41 text

SERVICE SERVICE SERVICE TRANSPORT DATABASE DATABASE DATABASE LOAD BALANCER HTTP API & ROUTING LAYER DATACENTRE n

Slide 42

Slide 42 text

No content

Slide 43

Slide 43 text

Simple Static typing Static linking

Slide 44

Slide 44 text

Concurrency Interfaces

Slide 45

Slide 45 text

stdlib eg. Networking

Slide 46

Slide 46 text

Go Kit micro gRPC Kite

Slide 47

Slide 47 text

mondough/typhon mondough/mercury

Slide 48

Slide 48 text

LOAD BALANCER

Slide 49

Slide 49 text

LOAD BALANCER HTTP API & ROUTING LAYER

Slide 50

Slide 50 text

API SERVICE LOAD BALANCER HTTP API & ROUTING LAYER

Slide 51

Slide 51 text

/webhooks —-> Webhook API

Slide 52

Slide 52 text

WEBHOOK API LOAD BALANCER HTTP API & ROUTING LAYER

Slide 53

Slide 53 text

WEBHOOK API AUTH SERVICE WEBHOOK SERVICE LOAD BALANCER HTTP API & ROUTING LAYER

Slide 54

Slide 54 text

WEBHOOK API AUTH SERVICE WEBHOOK SERVICE LOAD BALANCER HTTP API & ROUTING LAYER DATABASE

Slide 55

Slide 55 text

WEBHOOK API AUTH SERVICE WEBHOOK SERVICE LOAD BALANCER HTTP API & ROUTING LAYER DATABASE DATABASE

Slide 56

Slide 56 text

API SERVICE SERVICE A SERVICE B LOAD BALANCER HTTP API & ROUTING LAYER DATABASE DATABASE EXTERNAL PROVIDER

Slide 57

Slide 57 text

Event Driven Architectures

Slide 58

Slide 58 text

API SERVICE SERVICE A SERVICE B LOAD BALANCER HTTP API & ROUTING LAYER

Slide 59

Slide 59 text

API SERVICE SERVICE A SERVICE B LOAD BALANCER HTTP API & ROUTING LAYER

Slide 60

Slide 60 text

API SERVICE SERVICE A SERVICE B LOAD BALANCER HTTP API & ROUTING LAYER SERVICE C SERVICE D E

Slide 61

Slide 61 text

API SERVICE SERVICE A SERVICE B LOAD BALANCER HTTP API & ROUTING LAYER SERVICE C SERVICE D G E F

Slide 62

Slide 62 text

? ? ? LOAD BALANCER HTTP API & ROUTING LAYER ? ? ?? ? ? ? ? ? ? ?

Slide 63

Slide 63 text

SERVICE

Slide 64

Slide 64 text

Logic Handlers Storage SERVICE

Slide 65

Slide 65 text

mercury Logic Handlers Storage SERVICE

Slide 66

Slide 66 text

type Handler func(request) (response, error)

Slide 67

Slide 67 text

type Transport interface { ... }

Slide 68

Slide 68 text

type Transport interface { Listen(serviceName string, inbound chan<- request) error StopListening(serviceName string) bool Respond(req request, resp response) error Send(req request, timeout time.Duration) (response, error) ... }

Slide 69

Slide 69 text

type Transport interface { Listen(serviceName string, inbound chan<- request) error StopListening(serviceName string) bool Respond(req request, resp response) error Send(req request, timeout time.Duration) (response, error) ... }

Slide 70

Slide 70 text

mercury Logic Handlers Storage SERVICE

Slide 71

Slide 71 text

mercury Logic Handlers Storage libraries SERVICE

Slide 72

Slide 72 text

mercury Logic Handlers Storage libraries SERVICE Deployment Service Discovery Configuration Monitoring Authentication Authorisation Storage Circuit Breaking

Slide 73

Slide 73 text

No content

Slide 74

Slide 74 text

No content

Slide 75

Slide 75 text

Scratch Images

Slide 76

Slide 76 text

Statically Compiled

Slide 77

Slide 77 text

Root CA Certs

Slide 78

Slide 78 text

No content

Slide 79

Slide 79 text

Dealing with Complexity

Slide 80

Slide 80 text

Testing

Slide 81

Slide 81 text

Load Failure Degradation

Slide 82

Slide 82 text

Monitoring

Slide 83

Slide 83 text

Monitor your Business Logic

Slide 84

Slide 84 text

♥ customers

Slide 85

Slide 85 text

In-Band vs Out of Band

Slide 86

Slide 86 text

type Checker func() (error, map[string]string)

Slide 87

Slide 87 text

Distributed Tracing

Slide 88

Slide 88 text

api api api.customer api.customer service.customer service.customer

Slide 89

Slide 89 text

api api api.customer api.customer service.customer service.customer

Slide 90

Slide 90 text

8096820c-3b7b-47ec-bce6-1c239252ab40

Slide 91

Slide 91 text

api api api.customer api.customer service.customer service.customer

Slide 92

Slide 92 text

api api api.customer api.customer service.customer service.customer

Slide 93

Slide 93 text

Context Propagation

Slide 94

Slide 94 text

package context type Context interface { Deadline() (deadline time.Time, ok bool) Done() <-chan struct{} Err() error Value(key interface{}) interface{} }

Slide 95

Slide 95 text

package context type Context interface { Deadline() (deadline time.Time, ok bool) Done() <-chan struct{} Err() error Value(key interface{}) interface{} }

Slide 96

Slide 96 text

api api api.customer api.customer service.customer service.customer

Slide 97

Slide 97 text

api api api.customer api.customer service.customer service.customer SEND RECV SEND RECV RECV SEND RECV SEND

Slide 98

Slide 98 text

mondough/phosphor

Slide 99

Slide 99 text

api api.customer service.customer SEND RECV SEND RECV RECV SEND RECV SEND phosphor

Slide 100

Slide 100 text

No content

Slide 101

Slide 101 text

API card-api card-processing cards transactions balance transaction-enrichment merchant feed-generator feed apns API card-api card-processing cards transactions balance transaction-enrichment merchant feed-generator feed apns

Slide 102

Slide 102 text

API card-api card-processing cards transactions balance transaction-enrichment merchant feed-generator feed apns API card-api card-processing cards transactions balance transaction-enrichment merchant feed-generator feed apns

Slide 103

Slide 103 text

API card-api card-processing cards transactions balance transaction-enrichment merchant feed-generator feed apns API card-api card-processing cards transactions balance transaction-enrichment merchant feed-generator feed apns

Slide 104

Slide 104 text

API card-api card-processing cards transactions balance transaction-enrichment merchant feed-generator feed apns API card-api card-processing cards transactions balance transaction-enrichment merchant feed-generator feed apns

Slide 105

Slide 105 text

API card-api card-processing cards transactions balance transaction-enrichment merchant feed-generator feed apns API card-api card-processing cards transactions balance transaction-enrichment merchant feed-generator feed apns

Slide 106

Slide 106 text

No content

Slide 107

Slide 107 text

API card-api card-processing cards transactions balance transaction-enrichment merchant feed-generator feed apns API card-api card-processing cards transactions balance transaction-enrichment merchant feed-generator feed apns

Slide 108

Slide 108 text

No content

Slide 109

Slide 109 text

No content

Slide 110

Slide 110 text

No content

Slide 111

Slide 111 text

Small Simple Easy to learn

Slide 112

Slide 112 text

Concurrency Interfaces Networking

Slide 113

Slide 113 text

Downsides?

Slide 114

Slide 114 text

Starting with Microservices?

Slide 115

Slide 115 text

#yow2015 Thanks! @mattheath @getmondo

Slide 116

Slide 116 text

ATM: Thomas Hawk
 Bank of Commerce: ABQ Museum Archives IBM System/360: IBM Absorbed: Saxbald Photography Orbital Ion Cannon: www.rom.ac Go Gopher: Renee French Control Room: NASA ATM Failure: George Redgrave Credits