Slide 1

Slide 1 text

BUILDING A BANK
 WITH GO @mattheath Golang UK Conference 2015

Slide 2

Slide 2 text

@mattheath

Slide 3

Slide 3 text

Mondo

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

M

Slide 9

Slide 9 text

M

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 BOUNDED CONTEXT WELL DEFINED INTERFACES COMPOSABILITY

Slide 39

Slide 39 text

LOAD BALANCER

Slide 40

Slide 40 text

LOAD BALANCER HTTP API & ROUTING LAYER

Slide 41

Slide 41 text

SERVICE TRANSPORT LOAD BALANCER HTTP API & ROUTING LAYER

Slide 42

Slide 42 text

SERVICE SERVICE SERVICE TRANSPORT LOAD BALANCER HTTP API & ROUTING LAYER

Slide 43

Slide 43 text

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

Slide 44

Slide 44 text

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

Slide 45

Slide 45 text

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

Slide 46

Slide 46 text

No content

Slide 47

Slide 47 text

gRPC Go KIT Kite go-micro

Slide 48

Slide 48 text

mondough/typhon mondough/mercury

Slide 49

Slide 49 text

LOGIN
 API LOAD BALANCER HTTP API & ROUTING LAYER

Slide 50

Slide 50 text

LOGIN
 API AUTH SERVICE PERMS SERVICE LOAD BALANCER HTTP API & ROUTING LAYER

Slide 51

Slide 51 text

LOGIN
 API AUTH SERVICE PERMS SERVICE LOAD BALANCER HTTP API & ROUTING LAYER ACCOUNT SERVICE

Slide 52

Slide 52 text

LOGIN
 API AUTH SERVICE PERMS SERVICE LOAD BALANCER HTTP API & ROUTING LAYER ACCOUNT SERVICE FEED SERVICE

Slide 53

Slide 53 text

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

Slide 54

Slide 54 text

Logic Handler Storage SERVICE

Slide 55

Slide 55 text

mercury Logic Handler Storage SERVICE

Slide 56

Slide 56 text

mercury Logic Handler Storage libraries SERVICE

Slide 57

Slide 57 text

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

Slide 58

Slide 58 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 59

Slide 59 text

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

Slide 60

Slide 60 text

type Endpoint struct { Name string Handler Handler Request interface{} Response interface{} } type Handler func(req mercury.Request) (mercury.Response, error)

Slide 61

Slide 61 text

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

Slide 62

Slide 62 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 63

Slide 63 text

type Transport interface { Tomb() *tomb.Tomb Ready() <-chan struct{} Listen(serviceName string, inboundChan chan<- message.Request) error StopListening(serviceName string) bool Respond(request message.Request, response message.Response) error Send(req message.Request, timeout time.Duration) (message.Response, error) }

Slide 64

Slide 64 text

type Transport interface { Tomb() *tomb.Tomb Ready() <-chan struct{} Listen(serviceName string, inboundChan chan<- message.Request) error StopListening(serviceName string) bool Respond(request message.Request, response message.Response) error Send(req message.Request, timeout time.Duration) (message.Response, error) }

Slide 65

Slide 65 text

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

Slide 66

Slide 66 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 67

Slide 67 text

type ClientMiddleware interface { ProcessClientRequest(req mercury.Request) mercury.Request ProcessClientResponse(rsp mercury.Response, ctx context.Context) mercury.Response ProcessClientError(err *terrors.Error, ctx context.Context) } type ServerMiddleware interface { ProcessServerRequest(req mercury.Request) (mercury.Request, mercury.Response) ProcessServerResponse(rsp mercury.Response, ctx context.Context) mercury.Response }

Slide 68

Slide 68 text

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

Slide 69

Slide 69 text

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

Slide 70

Slide 70 text

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

Slide 71

Slide 71 text

mondough/phosphor mondough/phosphord

Slide 72

Slide 72 text

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

Slide 73

Slide 73 text

No content

Slide 74

Slide 74 text

No content

Slide 75

Slide 75 text

mercury Logic Handler Storage libraries SERVICE • PROVISIONING • SERVICE DISCOVERY • CONFIGURATION • MONITORING • AUTHENTICATION/AUTHORISATION • AB TESTING • SELF CONFIGURING CONNECTIVITY 
 TO THIRD-PARTY SERVICES

Slide 76

Slide 76 text

No content

Slide 77

Slide 77 text

SCRATCH STATIC SSL

Slide 78

Slide 78 text

DEALING WITH 
 COMPLEXITY

Slide 79

Slide 79 text

TESTING

Slide 80

Slide 80 text

LOAD FAILURE DEGRADATION

Slide 81

Slide 81 text

MONITORING

Slide 82

Slide 82 text

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

Slide 83

Slide 83 text

MONITOR YOUR BUSINESS LOGIC

Slide 84

Slide 84 text

No content

Slide 85

Slide 85 text

DISTRIBUTED
 TRACING

Slide 86

Slide 86 text

No content

Slide 87

Slide 87 text

No content

Slide 88

Slide 88 text

SMALL SIMPLE EASY TO LEARN

Slide 89

Slide 89 text

CONCURRENCY NETWORKING INTERFACES

Slide 90

Slide 90 text

DOWNSIDES?

Slide 91

Slide 91 text

STARTING WITH MICROSERVICES?

Slide 92

Slide 92 text

THANKS! @mattheath @getmondo Join our Alpha at getmondo.co.uk! Feedback: joind.in/14960

Slide 93

Slide 93 text

CREDITS 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