Slide 1

Slide 1 text

Building a Bank with Go Matt Heath, Mondo #bristech 2015

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

Time for a new kind of bank?

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

You're doing quite well

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

the majestik møøse

Slide 21

Slide 21 text

the majestik moose

Slide 22

Slide 22 text

sıkısınca

Slide 23

Slide 23 text

sikisinca

Slide 24

Slide 24 text

No content

Slide 25

Slide 25 text

No content

Slide 26

Slide 26 text

DATABASE APPLICATION

Slide 27

Slide 27 text

DATABASE APPLICATION

Slide 28

Slide 28 text

DATABASE DATABASES APPLICATION

Slide 29

Slide 29 text

DATABASE DATABASES APPLICATION SEARCH

Slide 30

Slide 30 text

DATABASE DATABASES APPLICATION CACHE SEARCH

Slide 31

Slide 31 text

DATABASE DATABASES APPLICATION CACHE SEARCH CAT GIFS

Slide 32

Slide 32 text

ALL HAIL THE MONOLITH

Slide 33

Slide 33 text

DO NOT WANT

Slide 34

Slide 34 text

DATABASE DATABASES MONOLITH CACHE SEARCH CAT GIFS

Slide 35

Slide 35 text

MONOLITH

Slide 36

Slide 36 text

No content

Slide 37

Slide 37 text

No content

Slide 38

Slide 38 text

Single Responsibility Principle

Slide 39

Slide 39 text

Bounded Context

Slide 40

Slide 40 text

Well defined Interfaces

Slide 41

Slide 41 text

Composability

Slide 42

Slide 42 text

LOAD BALANCER

Slide 43

Slide 43 text

LOAD BALANCER HTTP API & ROUTING LAYER

Slide 44

Slide 44 text

SERVICE TRANSPORT LOAD BALANCER HTTP API & ROUTING LAYER

Slide 45

Slide 45 text

SERVICE SERVICE SERVICE TRANSPORT LOAD BALANCER HTTP API & ROUTING LAYER

Slide 46

Slide 46 text

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

Slide 47

Slide 47 text

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

Slide 48

Slide 48 text

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

Slide 49

Slide 49 text

No content

Slide 50

Slide 50 text

Concurrency Networking Deployability

Slide 51

Slide 51 text

gRPC Go Kit Kite go-micro

Slide 52

Slide 52 text

mondough/typhon mondough/mercury

Slide 53

Slide 53 text

LOAD BALANCER

Slide 54

Slide 54 text

LOAD BALANCER HTTP API & ROUTING LAYER

Slide 55

Slide 55 text

SOME
 API LOAD BALANCER HTTP API & ROUTING LAYER

Slide 56

Slide 56 text

SOME
 API SERVICE ONE SERVICE TWO LOAD BALANCER HTTP API & ROUTING LAYER

Slide 57

Slide 57 text

SOME
 API SERVICE ONE SERVICE TWO LOAD BALANCER HTTP API & ROUTING LAYER DATABASE

Slide 58

Slide 58 text

SOME
 API SERVICE ONE SERVICE TWO LOAD BALANCER HTTP API & ROUTING LAYER DATABASE DATABASE

Slide 59

Slide 59 text

SOME
 API SERVICE ONE SERVICE TWO LOAD BALANCER HTTP API & ROUTING LAYER DATABASE DATABASE EXTERNAL PROVIDER

Slide 60

Slide 60 text

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

Slide 61

Slide 61 text

SERVICE

Slide 62

Slide 62 text

Logic Handlers Storage SERVICE

Slide 63

Slide 63 text

mercury Logic Handlers Storage SERVICE

Slide 64

Slide 64 text

mercury Logic Handlers Storage libraries SERVICE

Slide 65

Slide 65 text

func main() { }

Slide 66

Slide 66 text

func main() { srv := service.Init(service.Config{ Name: "service.account", Description: "Store bank accounts", }) srv.AddEndpoints( handler.Create, handler.Read, handler.List, ) srv.Run() }

Slide 67

Slide 67 text

func main() { srv := service.Init(service.Config{ Name: "service.account", Description: "Store bank accounts", }) srv.AddEndpoints( handler.Create, handler.Read, handler.List, ) srv.Run() }

Slide 68

Slide 68 text

func main() { srv := service.Init(service.Config{ Name: "service.account", Description: "Store bank accounts", }) srv.AddEndpoints( handler.Create, handler.Read, handler.List, ) srv.Run() }

Slide 69

Slide 69 text

type Handler func(request) (response, error)

Slide 70

Slide 70 text

type Endpoint struct { Name string Handler Handler Request interface{} Response interface{} }

Slide 71

Slide 71 text

func main() { srv := service.Init(service.Config{ Name: "service.account", Description: "boop", }) srv.AddEndpoints( handler.Create, handler.Read, handler.List, ) srv.Run() }

Slide 72

Slide 72 text

func main() { srv := service.Init(service.Config{ Name: "service.account", Description: "boop", }) srv.AddEndpoints( handler.Create, handler.Read, handler.List, ) srv.Run() }

Slide 73

Slide 73 text

type Server interface { Name() string AddEndpoints(eps ...Endpoint) RemoveEndpoints(eps ...Endpoint) Endpoint(name string) (Endpoint, bool) Endpoints() []Endpoint Start(trans transport.Transport) error Run(trans transport.Transport) Stop() Middleware() []ServerMiddleware SetMiddleware([]ServerMiddleware) AddMiddleware(ServerMiddleware) }

Slide 74

Slide 74 text

type Transport interface { Tomb() *tomb.Tomb Ready() <-chan struct{} 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 75

Slide 75 text

type Transport interface { Tomb() *tomb.Tomb Ready() <-chan struct{} 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 76

Slide 76 text

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

Slide 77

Slide 77 text

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

Slide 78

Slide 78 text

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

Slide 79

Slide 79 text

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

Slide 80

Slide 80 text

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

Slide 81

Slide 81 text

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

Slide 82

Slide 82 text

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

Slide 83

Slide 83 text

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

Slide 84

Slide 84 text

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

Slide 85

Slide 85 text

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

Slide 86

Slide 86 text

mercury Logic Handler Storage libraries SERVICE

Slide 87

Slide 87 text

mercury Logic Handler Storage libraries SERVICE PROVISIONING SERVICE DISCOVERY CONFIGURATION MONITORING AUTHENTICATION AUTHORISATION A/B TESTING STORAGE MESSAGING

Slide 88

Slide 88 text

No content

Slide 89

Slide 89 text

Scratch Static SSL

Slide 90

Slide 90 text

No content

Slide 91

Slide 91 text

Dealing with Complexity

Slide 92

Slide 92 text

TESTING

Slide 93

Slide 93 text

LOAD FAILURE DEGRADATION

Slide 94

Slide 94 text

MONITORING

Slide 95

Slide 95 text

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

Slide 96

Slide 96 text

MONITOR YOUR BUSINESS LOGIC

Slide 97

Slide 97 text

No content

Slide 98

Slide 98 text

DISTRIBUTED
 TRACING

Slide 99

Slide 99 text

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

Slide 100

Slide 100 text

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

Slide 101

Slide 101 text

mondough/phosphor

Slide 102

Slide 102 text

PhosphorD Service A Trace Library goroutine chan UDP Service B Trace Library goroutine chan UDP PHOSPHOR HOST INSTANCES PUBLISH DASHBOARDS AGGREGATION PERSISTANCE NSQ

Slide 103

Slide 103 text

No content

Slide 104

Slide 104 text

No content

Slide 105

Slide 105 text

No content

Slide 106

Slide 106 text

No content

Slide 107

Slide 107 text

Small Simple Easy to learn

Slide 108

Slide 108 text

Concurrency Networking Interfaces

Slide 109

Slide 109 text

Downsides?

Slide 110

Slide 110 text

Starting with microservices?

Slide 111

Slide 111 text

Thanks! @getmondo @mattheath Join our alpha at getmondo.co.uk!

Slide 112

Slide 112 text

ATM: Thomas Hawk
 IBM System/360: IBM Absorbed: Saxbald Photography Orbital Ion Cannon: www.rom.ac Go Gophers: Renee French Control Room: NASA ATM Failure: George Redgrave ATM: Thomas Hawk
 IBM System/360: IBM Absorbed: Saxbald Photography Orbital Ion Cannon: www.rom.ac Go Gophers: Renee French Control Room: NASA ATM Failure: George Redgrave Credits