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
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 Programming
See All in Programming
ブラウザ単体でmp4書き出すまで - muddy-web - 2024-12
yue4u
3
480
Асинхронность неизбежна: как мы проектировали сервис уведомлений
lamodatech
0
850
Keeping it Ruby: Why Your Product Needs a Ruby SDK - RubyWorld 2024
envek
0
190
テストコード書いてみませんか?
onopon
2
140
CQRS+ES の力を使って効果を感じる / Feel the effects of using the power of CQRS+ES
seike460
PRO
0
140
Zoneless Testing
rainerhahnekamp
0
120
선언형 UI에서의 상태관리
l2hyunwoo
0
180
数十万行のプロジェクトを Scala 2から3に完全移行した
xuwei_k
0
280
tidymodelsによるtidyな生存時間解析 / Japan.R2024
dropout009
1
790
htmxって知っていますか?次世代のHTML
hiro_ghap1
0
340
Security_for_introducing_eBPF
kentatada
0
110
rails statsで大解剖 🔍 “B/43流” のRailsの育て方を歴史とともに振り返ります
shoheimitani
2
940
Featured
See All Featured
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
28
2.1k
How GitHub (no longer) Works
holman
311
140k
Making the Leap to Tech Lead
cromwellryan
133
9k
Fireside Chat
paigeccino
34
3.1k
A Tale of Four Properties
chriscoyier
157
23k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
48
2.2k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
132
33k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
247
1.3M
Optimizing for Happiness
mojombo
376
70k
A better future with KSS
kneath
238
17k
What's in a price? How to price your products and services
michaelherold
243
12k
Six Lessons from altMBA
skipperchong
27
3.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