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
Building Microservice Architectures with Go - Y...
Search
mattheath
December 11, 2015
Programming
5
390
Building Microservice Architectures with Go - Yow! 2015
Presented at Yow! 2015 in Melbourne, Brisbane and Sydney
http://yowconference.com.au/
mattheath
December 11, 2015
Tweet
Share
More Decks by mattheath
See All by mattheath
Breaking down problems
mattheath
2
310
Contexts in Context
mattheath
0
180
A guided journey of Cloud Native
mattheath
1
130
Modelling prototypes to critical systems with Cassandra
mattheath
0
210
Building a Cloud Native Bank
mattheath
1
190
Building a Cloud Native Bank
mattheath
0
330
Building reliable APIs
mattheath
0
250
Go and Microservices - NDC London 2018
mattheath
0
230
Architecting a Bank from scratch
mattheath
1
770
Other Decks in Programming
See All in Programming
PHP でアセンブリ言語のように書く技術
memory1994
PRO
1
170
Webの技術スタックで マルチプラットフォームアプリ開発を可能にするElixirDesktopの紹介
thehaigo
2
1k
LLM生成文章の精度評価自動化とプロンプトチューニングの効率化について
layerx
PRO
2
190
광고 소재 심사 과정에 AI를 도입하여 광고 서비스 생산성 향상시키기
kakao
PRO
0
170
AI時代におけるSRE、 あるいはエンジニアの生存戦略
pyama86
6
1.1k
OnlineTestConf: Test Automation Friend or Foe
maaretp
0
110
ピラミッド、アイスクリームコーン、SMURF: 自動テストの最適バランスを求めて / Pyramid Ice-Cream-Cone and SMURF
twada
PRO
10
1.3k
役立つログに取り組もう
irof
28
9.6k
Snowflake x dbtで作るセキュアでアジャイルなデータ基盤
tsoshiro
2
520
Better Code Design in PHP
afilina
PRO
0
120
Streams APIとTCPフロー制御 / Web Streams API and TCP flow control
tasshi
2
350
Amazon Qを使ってIaCを触ろう!
maruto
0
400
Featured
See All Featured
YesSQL, Process and Tooling at Scale
rocio
169
14k
It's Worth the Effort
3n
183
27k
The Invisible Side of Design
smashingmag
298
50k
A Philosophy of Restraint
colly
203
16k
Designing for humans not robots
tammielis
250
25k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
246
1.3M
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
93
16k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2.1k
What's in a price? How to price your products and services
michaelherold
243
12k
How to Ace a Technical Interview
jacobian
276
23k
Transcript
Building Microservice Architectures with Go Matt Heath, Mondo #yow2015
@mattheath
None
None
1895
monoliths traditional dev
None
None
None
None
None
None
None
None
None
?
DATABASE APPLICATION
DATABASE APPLICATION
DATABASE DATABASES APPLICATION
DATABASE DATABASES APPLICATION SEARCH
DATABASE DATABASES APPLICATION CACHE SEARCH
DATABASE DATABASES APPLICATION CACHE SEARCH CAT GIFS
ALL HAIL THE MONOLITH
DO NOT WANT
DATABASE DATABASES APPLICATION CACHE SEARCH CAT GIFS
APPLICATION
None
None
Why Microservices at Mondo?
Single Responsibility Principle
Bounded Context
Well defined Interfaces
Composability
Why not start with Microservices?
LOAD BALANCER
LOAD BALANCER HTTP API & ROUTING LAYER
TRANSPORT LOAD BALANCER HTTP API & ROUTING LAYER
SERVICE SERVICE SERVICE TRANSPORT LOAD BALANCER HTTP API & ROUTING
LAYER
SERVICE SERVICE SERVICE TRANSPORT DATABASE DATABASE DATABASE LOAD BALANCER HTTP
API & ROUTING LAYER
SERVICE SERVICE SERVICE TRANSPORT DATABASE DATABASE DATABASE LOAD BALANCER DATACENTRE
n HTTP API & ROUTING LAYER
SERVICE SERVICE SERVICE TRANSPORT DATABASE DATABASE DATABASE LOAD BALANCER HTTP
API & ROUTING LAYER DATACENTRE n
None
Simple Static typing Static linking
Concurrency Interfaces
stdlib eg. Networking
Go Kit micro gRPC Kite
mondough/typhon mondough/mercury
LOAD BALANCER
LOAD BALANCER HTTP API & ROUTING LAYER
API SERVICE LOAD BALANCER HTTP API & ROUTING LAYER
/webhooks —-> Webhook API
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 DATABASE
WEBHOOK API AUTH SERVICE WEBHOOK SERVICE LOAD BALANCER HTTP API
& ROUTING LAYER DATABASE DATABASE
API SERVICE SERVICE A SERVICE B LOAD BALANCER HTTP API
& ROUTING LAYER DATABASE DATABASE EXTERNAL PROVIDER
Event Driven Architectures
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 E
API SERVICE SERVICE A SERVICE B LOAD BALANCER HTTP API
& ROUTING LAYER SERVICE C SERVICE D G E F
? ? ? LOAD BALANCER HTTP API & ROUTING LAYER
? ? ?? ? ? ? ? ? ? ?
SERVICE
Logic Handlers Storage SERVICE
mercury Logic Handlers Storage SERVICE
type Handler func(request) (response, error)
type Transport interface { ... }
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) ... }
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) ... }
mercury Logic Handlers Storage SERVICE
mercury Logic Handlers Storage libraries SERVICE
mercury Logic Handlers Storage libraries SERVICE Deployment Service Discovery Configuration
Monitoring Authentication Authorisation Storage Circuit Breaking
None
None
Scratch Images
Statically Compiled
Root CA Certs
None
Dealing with Complexity
Testing
Load Failure Degradation
Monitoring
Monitor your Business Logic
♥ customers
In-Band vs Out of Band
type Checker func() (error, map[string]string)
Distributed Tracing
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
Context Propagation
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
mondough/phosphor
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
Small Simple Easy to learn
Concurrency Interfaces Networking
Downsides?
Starting with Microservices?
#yow2015 Thanks! @mattheath @getmondo
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