~/talk

Multi-tenancy strategies with Django+PostgreSQL

Talkat PyCon AU 2023 · 2023-08-18..08-22· [django, databases]
slides:none on file

Three concrete strategies compete: separate app+db per tenant (strong isolation, expensive, painful at scale); schema-per-tenant or multiple DBs routed by middleware (single codebase, migrations and table‑lock limits bite, connection‑pooling makes connection stateful); and shared tables with tenant_id denormalization plus Django managers (easier querying, biggest risk is forgetting to filter). Postgres row level security and tools like Django tenants and django multi-tenant or Cytus sharding provide safety nets but add operational complexity. Threads, transactions and migrations are the usual failure modes.

AI-written summary · about

  1. 0:00Start
  2. 8:46MULTIPLE SCHEMAS
  3. 11:10SINGLE DATABASE
  4. 26:05SUMMARY
~/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.