Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Microservices & Go - GOTO Copenhagen 2016
Search
mattheath
October 04, 2016
Technology
2
1.5k
Microservices & Go - GOTO Copenhagen 2016
mattheath
October 04, 2016
Tweet
Share
More Decks by mattheath
See All by mattheath
Breaking down problems
mattheath
2
320
Contexts in Context
mattheath
0
180
A guided journey of Cloud Native
mattheath
1
130
Modelling prototypes to critical systems with Cassandra
mattheath
0
220
Building a Cloud Native Bank
mattheath
1
190
Building a Cloud Native Bank
mattheath
0
330
Building reliable APIs
mattheath
0
260
Go and Microservices - NDC London 2018
mattheath
0
230
Architecting a Bank from scratch
mattheath
1
770
Other Decks in Technology
See All in Technology
社内イベント管理システムを1週間でAKSからACAに移行した話し
shingo_kawahara
0
190
5分でわかるDuckDB
chanyou0311
10
3.2k
ブラックフライデーで購入したPixel9で、Gemini Nanoを動かしてみた
marchin1989
1
540
マルチプロダクト開発の現場でAWS Security Hubを1年以上運用して得た教訓
muziyoshiz
3
2.4k
Turing × atmaCup #18 - 1st Place Solution
hakubishin3
0
490
プロダクト開発を加速させるためのQA文化の築き方 / How to build QA culture to accelerate product development
mii3king
1
270
マイクロサービスにおける容易なトランザクション管理に向けて
scalar
0
140
組織に自動テストを書く文化を根付かせる戦略(2024冬版) / Building Automated Test Culture 2024 Winter Edition
twada
PRO
17
4.8k
ゼロから創る横断SREチーム 挑戦と進化の軌跡
rvirus0817
2
270
バクラクのドキュメント解析技術と実データにおける課題 / layerx-ccc-winter-2024
shimacos
2
1.1k
私なりのAIのご紹介 [2024年版]
qt_luigi
1
120
Amazon Kendra GenAI Index 登場でどう変わる? 評価から学ぶ最適なRAG構成
naoki_0531
0
120
Featured
See All Featured
Measuring & Analyzing Core Web Vitals
bluesmoon
4
170
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
48
2.2k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.5k
Designing on Purpose - Digital PM Summit 2013
jponch
116
7k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
How to Ace a Technical Interview
jacobian
276
23k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.3k
Scaling GitHub
holman
458
140k
How To Stay Up To Date on Web Technology
chriscoyier
789
250k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Transcript
Microservices & Go Matt Heath, Monzo
None
Hi, I’m Matt @mattheath
None
None
None
monoliths traditional dev
None
None
None
None
None
None
None
None
None
?
Application
Application Database
Application Database
Application Databases
Application Databases Search
Application Databases Search Caching
Application Databases Search Caching CAT GIFS
ALL HAIL THE MONOLITH
None
Application Databases Search Caching CAT GIFS
APPLICATION Application
None
None
Single Responsibility Principle
Bounded Context
Well defined Interfaces
Composability
None
Simple
Lightweight Concurrency
// Blocking handleRequest()
// Runs concurrently // in a goroutine go handleRequest()
Go Routines
Channels
Static Linking
None
None
monzo/typhon
Service Service
Service Service Message Bus
Service Service Message Bus Request Queue
Service Service Message Bus Service Service Request Queue - Service
Discovery - Load Balancing
Service Service Message Bus Service Service Pull Request Queue
Service Service Message Bus Service Service
0 40 80 160 120 Feb 2015 Oct 2016
Service Service Message Bus Service Service Client library Server library
Service Service Service Service HTTP HTTP
Service Discovery Load Balancing Timeouts and Expirations Retries Rate Limiting
Connection Pooling Circuit Breaking Failure Detection Metrics and Tracing Interrupts Context Propagation
Service Service Service Service HTTP HTTP ?
Service Service Service Service HTTP HTTP linkerd
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 HTTP API & Routing Layer
Load Balancer HTTP API & Routing Layer API Service
None
/webhooks —-> Webhook API
Load Balancer HTTP API & Routing Layer Webhook API
Auth Service Webhook Service Load Balancer HTTP API & Routing
Layer Webhook API
Auth Service Webhook Service Load Balancer HTTP API & Routing
Layer Webhook API Database
Database Auth Service Webhook Service Load Balancer HTTP API &
Routing Layer Webhook API Database
External Provider Database Auth Service Webhook Service Load Balancer HTTP
API & Routing Layer Webhook API Database
type Service func(req Request) Response
router.GET("/", List) router.POST("/", Register) router.DELETE("/:id", Deregister)
Making our service reliable
+ = ❤
None
Webhook Service Webhook Service Webhook Service Load Balancer HTTP API
& Routing Layer Webhook API
Webhook Service Webhook Service Webhook Service Load Balancer HTTP API
& Routing Layer Webhook API
Webhook Service Webhook Service Webhook Service Webhook Service Load Balancer
HTTP API & Routing Layer Webhook API
Webhook Service Webhook Service Webhook Service Webhook Service Load Balancer
HTTP API & Routing Layer Webhook API Slow or Errors
Event Driven Architecture
Service A Service B Load Balancer HTTP API & Routing
Layer API Service
API Service Service A Service B Load Balancer HTTP API
& Routing Layer
API Service Service A Service B Load Balancer HTTP API
& Routing Layer
API Service Service A Service B Load Balancer HTTP API
& Routing Layer Service C Service D Service E
Context Propagation
api api api.customer api.customer service.customer service.customer
api api api.customer api.customer service.customer service.customer
8096820c-3b7b-47ec-bce6-1c239252ab40
api api api.customer api.customer service.customer service.customer
api api api.customer api.customer service.customer service.customer
package context type Context interface { Deadline() (deadline time.Time, ok
bool) Done() <-chan struct{} Err() error Value(key interface{}) interface{} }
package context type Context interface { Deadline() (deadline time.Time, ok
bool) Done() <-chan struct{} Err() error Value(key interface{}) interface{} }
package context type Context interface { Deadline() (deadline time.Time, ok
bool) Done() <-chan struct{} Err() error Value(key interface{}) interface{} }
api api api.customer api.customer service.customer service.customer
api api api.customer api.customer service.customer service.customer SEND RECV SEND RECV
RECV SEND RECV SEND
api api.customer service.customer SEND RECV SEND RECV RECV SEND RECV
SEND phosphor
None
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
None
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
None
None
None
None
Small Simple Easy to learn
Concurrency Channels
Downsides?
Starting with Microservices?
Thanks! @mattheath @monzo
ATM: Thomas Hawk Bank of Commerce: ABQ Museum Archives IBM
System/360: IBM Absorbed: Saxbald Photography Go Gopher: Renee French Credits
None