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
Services, Architecture and Channels
Search
Andrew Godwin
April 03, 2017
Programming
4
690
Services, Architecture and Channels
A talk I gave at DjangoCon Europe 2017 in Florence, Italy
Andrew Godwin
April 03, 2017
Tweet
Share
More Decks by Andrew Godwin
See All by Andrew Godwin
Reconciling Everything
andrewgodwin
1
340
Django Through The Years
andrewgodwin
0
250
Writing Maintainable Software At Scale
andrewgodwin
0
470
A Newcomer's Guide To Airflow's Architecture
andrewgodwin
0
370
Async, Python, and the Future
andrewgodwin
2
690
How To Break Django: With Async
andrewgodwin
1
750
Taking Django's ORM Async
andrewgodwin
0
750
The Long Road To Asynchrony
andrewgodwin
0
690
The Scientist & The Engineer
andrewgodwin
1
790
Other Decks in Programming
See All in Programming
例外処理を理解して、設計段階からエラーを見つけやすく、起こりにくく #phpconfuk
kajitack
12
6.3k
AIの弱点、やっぱりプログラミングは人間が(も)勉強しよう / YAPC AI and Programming
kishida
10
5.2k
Rails Girls Sapporo 2ndの裏側―準備の日々から見えた、私が得たもの / SAPPORO ENGINEER BASE #11
lemonade_37
2
180
flutter_kaigi_2025.pdf
kyoheig3
1
350
The Missing Link in Angular's Signal Story: Resource API and httpResource
manfredsteyer
PRO
0
140
TypeScriptで設計する 堅牢さとUXを両立した非同期ワークフローの実現
moeka__c
0
260
Bakuraku E2E Scenario Test System Architecture #bakuraku_qa_study
teyamagu
PRO
0
780
スタートアップを支える技術戦略と組織づくり
pospome
7
8.3k
仕様がそのままテストになる!Javaで始める振る舞い駆動開発
ohmori_yusuke
8
4.6k
FlutterKaigi 2025 システム裏側
yumnumm
0
1.1k
AIエージェントでのJava開発がはかどるMCPをAIを使って開発してみた / java mcp for jjug
kishida
4
750
JJUG CCC 2025 Fall: Virtual Thread Deep Dive
ternbusty
3
470
Featured
See All Featured
Building an army of robots
kneath
306
46k
How to Ace a Technical Interview
jacobian
280
24k
Practical Orchestrator
shlominoach
190
11k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
31
2.7k
Principles of Awesome APIs and How to Build Them.
keavy
127
17k
Done Done
chrislema
186
16k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.3k
Learning to Love Humans: Emotional Interface Design
aarron
274
41k
Git: the NoSQL Database
bkeepers
PRO
432
66k
Automating Front-end Workflow
addyosmani
1371
200k
How GitHub (no longer) Works
holman
315
140k
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
Transcript
Andrew Godwin @andrewgodwin
Andrew Godwin Hi, I'm Django core developer Senior Software Engineer
at Apparently now does software architecture
The Monolith
The Monolith Only one version of any dependency Everything can
import everything Deployed all at once No separation Side-effects from other code
None
Services Code split up by purpose/team Defined cross-boundary API Deployed
separately Can use different versions of dependencies Isolated from each other
Why services?
Easier to manage Smaller, self-contained problems
Independent Scaling And easier performance analysis
Faster Individual Deployment Less to deploy at once
Complex Interdependencies Harder to deploy & track bugs
Requires great communication Teams need calling contracts and APIs
More points of failure Not just one set of homogenous
servers
No more quick hacks Separation forces a level of code
design
Switching To Services Or: How I Learned To Stop Worrying
And Love The Monolith
Identify the "cut points" You might need to make some
Allocate inventory Calculate Price & Charge card Finalise order Make
Order Row &
Make Order Row Allocate inventory Calculate Price Charge card Finalise
inventory Finalise order
Make Order Row Allocate inventory Calculate Price Charge card Finalise
inventory Finalise order
Define APIs between services Behave like all other teams are
third-party
Separate Datastores & Servers Make them as separate as possible
Communication & Transport
Service 2 Service 3 Service 1
Service 2 Service 3 Service 1 Direct Communication (20 services?
190 connections!)
Service 2 Service 3 Service 1 Direct with discovery Orchestrator
Service 2 Service 3 Service 1 Centralised Routing Router
Service 2 Service 3 Service 1 Message Bus
Centralised Comms Tradeoffs Distributed Comms Single point of failure Nasty
partial failures
At-least-once delivery Tradeoffs At-most-once delivery Some messages duplicated Some messages
lost
First-In-First-Out Tradeoffs First-In-Last-Out Easily backlogged Wide range of latencies
Channels & ASGI
Channel Layer Interface Server Worker Server Process 1 ASGI ASGI
Asynchronous socket handling Synchronous Django project Interface Server Worker Server ASGI ASGI Worker Server ASGI Process 2 Process 3 Process 4
Service 2 Service 3 Service 1 Channel Layer
Service Client inventory.request response.aF53Vds21
At-most-once delivery ASGI's Tradeoffs You have to design for potential
loss Low-latency but non-persistent Good for protocols, bad for important task queues Capacity, Backpressure and FIFO Informs producers quickly about pileups in the queue
Top Service-Oriented Architecture Tips
Per-request "correlation IDs" Track a set of service calls through
the stack
Feature Flag message headers Bundle them in, don't have every
service query them
Source Of Truth Each data model has a service that
owns (& caches) it
Metrics. Metrics everywhere. Both performance and network health
Design for failure Don't assume two things will both succeed
DO NOT START OFF WITH SERVICES Write separate Python libraries
instead
Thanks. Andrew Godwin @andrewgodwin