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
170
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
Kotlin2でdataクラスの copyメソッドを禁止する/Data class copy function to have the same visibility as constructor
eichisanden
1
140
ピラミッド、アイスクリームコーン、SMURF: 自動テストの最適バランスを求めて / Pyramid Ice-Cream-Cone and SMURF
twada
PRO
9
1k
Googleのテストサイズを活用したテスト環境の構築
toms74209200
0
270
GitHub Actionsのキャッシュと手を挙げることの大切さとそれに必要なこと
satoshi256kbyte
5
390
Java ジェネリクス入門 2024
nagise
0
600
Kubernetes for Data Engineers: Building Scalable, Reliable Data Pipelines
sucitw
1
200
qmuntal/stateless のススメ
sgash708
0
120
Jakarta Concurrencyによる並行処理プログラミングの始め方 (JJUG CCC 2024 Fall)
tnagao7
1
230
Piniaの現状と今後
waka292
5
1.5k
Why Spring Matters to Jakarta EE - and Vice Versa
ivargrimstad
0
980
Go言語でターミナルフレンドリーなAIコマンド、afaを作った/fukuokago20_afa
monochromegane
2
140
LLM生成文章の精度評価自動化とプロンプトチューニングの効率化について
layerx
PRO
2
140
Featured
See All Featured
Large-scale JavaScript Application Architecture
addyosmani
510
110k
What's in a price? How to price your products and services
michaelherold
243
12k
Intergalactic Javascript Robots from Outer Space
tanoku
268
27k
Visualization
eitanlees
144
15k
Code Reviewing Like a Champion
maltzj
519
39k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Facilitating Awesome Meetings
lara
49
6k
Learning to Love Humans: Emotional Interface Design
aarron
272
40k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.4k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
126
18k
Art, The Web, and Tiny UX
lynnandtonic
296
20k
Into the Great Unknown - MozCon
thekraken
31
1.5k
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