Back to projects
Architecture Deep DiveIn Progress

Multi-Tenant Task Manager

A task management platform where each organization is fully isolated at the PostgreSQL schema level using django-tenants. Tenants are resolved by subdomain, so acme.app and globex.app hit the same Django process but read and write completely separate schemas.

Highlights

  • Schema-per-tenant isolation with django-tenants
  • Subdomain-based tenant routing middleware
  • Shared apps vs tenant apps separation
  • Automated tenant provisioning and migrations
  • DRF API scoped to the active tenant

Architecture Decision Records

Schema-level multi-tenancy over row-level

Context: We needed strong data isolation between organizations without scattering tenant_id filters across every query.

Decision: Use separate PostgreSQL schemas per tenant. This guarantees isolation at the database layer and keeps application queries clean, at the cost of more involved migrations.

Subdomain routing for tenant resolution

Context: Tenants need a stable, user-friendly way to reach their isolated environment.

Decision: Resolve the tenant from the request subdomain in middleware and switch the active schema per request, keeping URLs clean and tenants unambiguous.