Professional Documents
Culture Documents
with Go
Matt Heath, Monzo
Hi, Im Matt
@mattheath
monoliths
traditional dev
LICENCE WITH
RESTRICTIONS
50K MAX
DEPOSIT
WE ARE
HERE
FEB MAR APR MAY JUN JUL AUG SEP NOV DEC JAN FEB MAR APR MAY JUN JUL AUG SEP NOV DEC JAN FEB MAR APR MAY JUN JUL
2015 2016 2017
A UK banking licence is authorised by the PRA and This is followed by a mobilisation phase during
regulated by the PRA and FCA1, allowing deposit- which final capital is raised and IT systems are
taking and balance sheet lending. Once granted, completed, before launching to the public.
it allows firms to passport across Europe, accessing
?
Application
Application
Database
Application
Database
Application
Databases
Application
Search Databases
Application
Caching
Search Databases
Application
Caching
Search Databases
CAT GIFS
ALL
HAIL
THE
MONOLITH
Application
Caching
Search Databases
CAT GIFS
APPLICATION
Application
Single Responsibility
Principle
Bounded Context
Well defined
Interfaces
Why Go?
Memory Managed
Statically Typed
Excellent Concurrency
Perfect for simple, small, network services
Lightweight
Concurrency
Goroutines
// Blocking function call
handleRequest()
// Function runs concurrently
go handleRequest()
package main
func main() {
go handleRequest()
//
}
package main main
func main() {
go handleRequest()
//
}
package main main
func main() {
go handleRequest() handleRequest
//
}
"Do not communicate by
sharing memory; instead, share
memory by communicating."
- Effective Go
Channels
Simplicity
Static Linking
Stdlib
etc
200
160
120
80
40
0
Number of services
Feb Mar
2015 2017
monzo/typhon
Service
Service
Service
Transport
Service
Service
Transport
Transport
Server library
Service Service Service
Service
HTTP
HTTP
Service Service Service
Service Discovery
Load Balancing
Timeouts and Expirations
Retries
Rate Limiting
Connection Pooling
Circuit Breaking
Failure Detection
Metrics and Tracing
Interrupts
Context Propagation
Service
HTTP
?
HTTP
Service Service Service
Service
HTTP
linkerd
HTTP
Service Service Service
Service Discovery
Load Balancing
Timeouts and Expirations
Retries
Rate Limiting
Connection Pooling
Circuit Breaking
Failure Detection
Metrics and Tracing
Interrupts
Context Propagation
Load Balancer
Load Balancer
API
Service
/webhooks -> Webhook API
Load Balancer
Webhook
API
Load Balancer
Webhook
API
Auth Webhook
Service Service
Load Balancer
Webhook
API
Auth Webhook
Database
Service Service
Load Balancer
Webhook
API
Auth Webhook
Database
Service Service
Database
Load Balancer
Webhook
API
External
Provider
Auth Webhook
Database
Service Service
Database
type Service func(req Request) Response
router.GET("/", List)
router.POST("/", Register)
router.DELETE("/:id", Deregister)
Making our
service reliable
+ =
Load Balancer
Webhook
API
Webhook
API
Webhook
API Webhook
Service
Webhook
API Webhook
Service
API
Service
Service Service
A B
Load Balancer
API
Service
Service Service
A B
Load Balancer
API
Service
Service Service
A B
Load Balancer
Service
API C
Service
Service
D
Service Service
A B
Service
E
Context
Propagation
api api.customer service.customer
SEND
RECV SEND
RECV
SEND
SEND RECV
RECV
SEND
RECV SEND
RECV
SEND
SEND RECV
RECV
phosphor
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
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
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
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
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
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
Perfect for
microservice
architectures
Concurrency:
Goroutines
Channels
Small
Simple
Easy
Thanks!
@mattheath
@monzo