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
890
Taking Django Distributed
A talk I gave at DjangoCon US 2017.
Andrew Godwin
August 16, 2017
Tweet
Share
More Decks by Andrew Godwin
See All by Andrew Godwin
Reconciling Everything
andrewgodwin
1
260
Django Through The Years
andrewgodwin
0
160
Writing Maintainable Software At Scale
andrewgodwin
0
390
A Newcomer's Guide To Airflow's Architecture
andrewgodwin
0
310
Async, Python, and the Future
andrewgodwin
2
610
How To Break Django: With Async
andrewgodwin
1
660
Taking Django's ORM Async
andrewgodwin
0
670
The Long Road To Asynchrony
andrewgodwin
0
590
The Scientist & The Engineer
andrewgodwin
1
690
Other Decks in Programming
See All in Programming
N.E.X.T LEVEL
pluu
2
300
The rollercoaster of releasing an Android, iOS, and macOS app with Kotlin Multiplatform | droidcon Italy
prof18
0
150
アクターシステムに頼らずEvent Sourcingする方法について
j5ik2o
4
150
Cloudflare MCP ServerでClaude Desktop からWeb APIを構築
kutakutat
1
530
create_tableをしただけなのに〜囚われのuuid編〜
daisukeshinoku
0
240
Security_for_introducing_eBPF
kentatada
0
110
Discord Bot with AI -for English learners-
xin9le
1
120
선언형 UI에서의 상태관리
l2hyunwoo
0
130
KubeCon + CloudNativeCon NA 2024 Overviewat Kubernetes Meetup Tokyo #68 / amsy810_k8sjp68
masayaaoyama
0
240
Webエンジニア主体のモバイルチームの 生産性を高く保つためにやったこと
igreenwood
0
330
testcontainers のススメ
sgash708
1
120
CSC305 Lecture 25
javiergs
PRO
0
130
Featured
See All Featured
GraphQLとの向き合い方2022年版
quramy
44
13k
Designing for humans not robots
tammielis
250
25k
Side Projects
sachag
452
42k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.9k
Six Lessons from altMBA
skipperchong
27
3.5k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
510
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
The Cult of Friendly URLs
andyhume
78
6.1k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
5
440
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