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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Andrew Godwin
April 03, 2017
Programming
720
4
Share
Services, Architecture and Channels
A talk I gave at DjangoCon Europe 2017 in Florence, Italy
Andrew Godwin
April 03, 2017
More Decks by Andrew Godwin
See All by Andrew Godwin
Reconciling Everything
andrewgodwin
1
390
Django Through The Years
andrewgodwin
0
310
Writing Maintainable Software At Scale
andrewgodwin
0
520
A Newcomer's Guide To Airflow's Architecture
andrewgodwin
0
420
Async, Python, and the Future
andrewgodwin
2
730
How To Break Django: With Async
andrewgodwin
1
810
Taking Django's ORM Async
andrewgodwin
0
830
The Long Road To Asynchrony
andrewgodwin
0
760
The Scientist & The Engineer
andrewgodwin
1
850
Other Decks in Programming
See All in Programming
[KCD Czech] eBPF Meets the GPU: Future of AI Infra Observability
doniacld
0
130
AIとRubyの静的型付け
ukin0k0
0
480
ReactとSvelteのその先、Ripple-TS / Beyond React and Svelte: Ripple-TS
ssssota
3
1.8k
iOS26時代の新規アプリ開発
yuukiw00w
0
220
タクシーアプリ『GO』の バックエンド開発のおける AI利活用と若者のすべて
pyama86
3
1.8k
Talking to terminals (and how they talk back) (KotlinConf 2026)
jakewharton
PRO
1
170
脅威をエンジニアリングの糧にして――現場編 / Turning Threats into Engineering Fuel — Field Edition
nrslib
0
220
初めてのRubyKaigiはこう見えた
jellyfish700
0
380
TSKaigi2026-静的解析への投資がAI時代のコード品質を支える ── カスタムESLintルールの設計と運用
hayatokudou
7
1.3k
新規プロダクトを高速で生み出すハーネスエンジニアリング
seanchas116
18
7.7k
AI時代の仕事技芸論 — ソフトウェア開発で「遊ぶように働く」職人的熟達のすすめ
kuranuki
1
550
AIエージェントと協働するCLI開発 — BunとOpenClawで学んだこと
yoshikouki
1
230
Featured
See All Featured
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.6k
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.2k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
180
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
2k
Discover your Explorer Soul
emna__ayadi
2
1.1k
How to make the Groovebox
asonas
2
2.2k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
570
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
710
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
190
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
1
130
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
440
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