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
220
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
macOS でできる リアルタイム動画像処理
biacco42
9
2.4k
Ethereum_.pdf
nekomatu
0
470
Hotwire or React? ~アフタートーク・本編に含めなかった話~ / Hotwire or React? after talk
harunatsujita
1
120
ピラミッド、アイスクリームコーン、SMURF: 自動テストの最適バランスを求めて / Pyramid Ice-Cream-Cone and SMURF
twada
PRO
10
1.3k
AWS Lambdaから始まった Serverlessの「熱」とキャリアパス / It started with AWS Lambda Serverless “fever” and career path
seike460
PRO
1
260
初めてDefinitelyTypedにPRを出した話
syumai
0
420
Outline View in SwiftUI
1024jp
1
330
Compose 1.7のTextFieldはPOBox Plusで日本語変換できない
tomoya0x00
0
200
PHP でアセンブリ言語のように書く技術
memory1994
PRO
1
170
ActiveSupport::Notifications supporting instrumentation of Rails apps with OpenTelemetry
ymtdzzz
1
250
CSC509 Lecture 13
javiergs
PRO
0
110
ローコードSaaSのUXを向上させるためのTypeScript
taro28
1
630
Featured
See All Featured
Optimizing for Happiness
mojombo
376
70k
Mobile First: as difficult as doing things right
swwweet
222
8.9k
Code Review Best Practice
trishagee
64
17k
BBQ
matthewcrist
85
9.3k
Designing on Purpose - Digital PM Summit 2013
jponch
115
7k
Visualization
eitanlees
145
15k
Navigating Team Friction
lara
183
14k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
506
140k
Writing Fast Ruby
sferik
627
61k
The Language of Interfaces
destraynor
154
24k
GraphQLとの向き合い方2022年版
quramy
43
13k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
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