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
Taking Django Distributed
Search
Andrew Godwin
August 16, 2017
Programming
1.1k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Taking Django Distributed
A talk I gave at DjangoCon US 2017.
Andrew Godwin
August 16, 2017
More Decks by Andrew Godwin
See All by Andrew Godwin
Reconciling Everything
andrewgodwin
1
410
Django Through The Years
andrewgodwin
0
330
Writing Maintainable Software At Scale
andrewgodwin
0
540
A Newcomer's Guide To Airflow's Architecture
andrewgodwin
0
430
Async, Python, and the Future
andrewgodwin
2
750
How To Break Django: With Async
andrewgodwin
1
830
Taking Django's ORM Async
andrewgodwin
0
860
The Long Road To Asynchrony
andrewgodwin
0
780
The Scientist & The Engineer
andrewgodwin
1
860
Other Decks in Programming
See All in Programming
改善しないと、タスクが回らない。 “てんこ盛りポジション” を引き継いだ情シスの、入社3ヶ月の業務改善録
krm963
0
280
PyConJP2026_wat_Python × Signal Processing: How to Draw Pictures with Sound Using Spectrogram Art
wat
0
180
Oxlintはいいぞ(続)
yug1224
1
390
リアルな遅延を測る仕様
kota_yata
1
120
初めての模倣学習とVLA
natsutan
0
180
自動化したのに回らない テスト運用の壁―AI時代の品質責任と生産性
mfunaki
0
410
為什麼你並不需要ViewModel / No, you don't need a ViewModel
lovee
1
510
Pythonの実行はどこまで賢くなったのか? CPythonとPyPyから見る最適化のしくみ
curekoshimizu
3
1.6k
Jindong: Introducing Declarative Haptics in Compose Multiplatform
l2hyunwoo
0
130
異なる設計思想のフレームワークを経験して得た学び
amekuhideki
1
150
不幸な GC
chencmd
0
610
Building a Meta Ray-Ban display app
akkeylab
0
180
Featured
See All Featured
WENDY [Excerpt]
tessaabrams
11
39k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
120
120k
Visualization
eitanlees
152
17k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
450
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
410
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.5k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
730
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
660
The Curious Case for Waylosing
cassininazir
1
480
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.5k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.7k
Transcript
Taking Django Distributed Andrew Godwin @andrewgodwin Taking Django Distributed
Hi, I’m Andrew Godwin • Django core developer • Senior
Software Engineer at • Needs to stop running towards code on fire
Computers hate you.
This makes distributed hard.
2001: A Space Odyssey Copyright Warner Brothers
It’s time to split things up a bit. But how?
And why?
Code Databases Team
There is no one solution
Read-heavy? Write-heavy? Spiky? Predictable? Chatty?
Code
Use apps! They’re a good start! Ignore the way I
wrote code for the first 5 years of Django.
Formalise interfaces between apps Preferably in an RPC style
Split along those interfaces Into separate processes, or machines
Inventory Payments Presentation
How do you communicate? HTTP? Channels? Smoke signals?
None
None
None
None
Databases
Users Vertically Partitioned Database Images Comments
Main DB Replica Replica Replica Single main database with replication
Partition Tolerant Available Consistent
Non-consistency is everywhere It’s sneaky like that
National Museum of American History
Load Balancing
Equally balanced servers Consistent load times Similar users
Split logic Different processor loads Wildly varying users
Reqs Time
Reqs Time
W E B S O C K E T S
W E B S O C K E T S
• They can last for hours • There’s not many tools that handle them • They have 4 different kinds of failure
Design for failure, and then use it! Kill off sockets
early and often.
Team
Developers are people too! They need time and interesting things
Technical debt can be poisonous But you need a little
bit to compete
Single repo? Multiple repos? Each has distinct advantages.
Teams per service? Split responsibility? Do you split ops/QA across
teams too?
Ownership gaps They’re very hard to see.
Strategies
Don’t go too micro on those services It’s easier in
the short term, but will confuse you in the long term.
Communicate over a service bus Preferably Channels, but you get
to choose.
Work out where to allow old data Build in deliberate
caching or read only modes
Design for future sharding Route everything through one model or
set of functions
Expect long-polls/sockets to die Design for load every time, and
treat as a happy optimisation
Independent, full-stack teams From ops to frontend, per major service
Architect as a part-time position You need some, but not
in an ivory tower
2001: A Space Odyssey Copyright Warner Brothers
Maybe, just maybe, keep that monolith A well maintained and
separated one beats bad distributed
Thanks. Andrew Godwin @andrewgodwin aeracode.org