~/talk

Of Django, PostgreSQL schemas, and your multi-million dollar idea

Talkat PyConline AU 2020 · 2020-09-04..09-06· [django, databases]
links:none on file
slides:none on file

Django plus PostgreSQL schemas works but with concrete tradeoffs: packages like django-tenant-schemas and django-tenants implement a custom DB backend, migrate hooks and routers; tenant creation is slow because each new schema runs migrations unless you clone a provisioning schema; migrations and backups slow as tenants grow; a rough capacity formula is scary number: 1_000_000 / tables_per_tenant (≈10,000 tenants at 100 tables); users, sessions and shared-vs-private model placement cause real leakage risks; sharding by mapping schemas to physical databases is possible but nontrivial.

AI-written summary · about

  1. 0:00Intro
  2. 3:08Database approaches
  3. 4:11PostgreSQL schemas in Django
  4. 6:22Tenants, schemas and models
  5. 9:11Where to put users?
  6. 10:47Moving models between schemas
  7. 12:04Tenant creation is slow
  8. 12:55You know what else is slow?
  9. 13:43Zero downtime deployments
  10. 14:53Other middle-term challenges
  11. 16:00Tables, tables and more tables
  12. 18:22Why don't we shard?
  13. 20:38The moment of chaos
  14. 21:22Is multi-tenancy through schemas de facto wrong as a choice?
  15. 22:11Should you change your database architecture to something other than schemas?
  16. 23:34And that's it!
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 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
?
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.