~/talk

Scaling the database - using multiple databases with Django

Talkat DjangoCon Europe 2026 · 2026-04-15..04-19· [databases]
links:none on file
slides:none on file

Django is run against a single primary + replicas setup where writes go to the primary and reads go through a load balancer (pgbouncer or pgdog) across three replicas; this hides failed nodes and scales reads. A small database router (~17 lines) routes reads to replicas but checks transaction.get_autocommit to avoid visibility bugs (uncommitted inserts read as zero). Workarounds include optimizing get_or_create and forcing generic-relations to the primary; tested on AWS RDS with single‑digit ms replication lag and works in practice.

AI-written summary · about

  1. 0:00Introduction and welcome
  2. 1:07Scaling basics explained
  3. 3:18Database sharding overview
  4. 3:59Primary-replica setup benefits
  5. 5:42Load balancers for databases
  6. 7:04Configuring Django databases
  7. 8:31Database routers in Django
  8. 11:42Challenges at scale
  9. 12:03Transaction consistency issues
  10. 14:12Django ORM optimizations
  11. 16:22Bugs in Django discovered
  12. 19:12Generic relations workaround
  13. 20:15Recap and benefits summary
  14. 22:24Q&A session
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.