Multi-tenant SaaS: decisions to make before writing features
Multi-tenancy is a product and data decision before it is a framework feature. The right architecture depends on isolation requirements, customer variation, operational scale, and the way the team expects the product to evolve.
Start with isolation
Decide whether tenants share a schema, use separate schemas, or require separate databases. Make tenant context explicit in requests, jobs, caches, logs, and administrative tools.
Model roles around work
Permissions should represent what people actually do. Use clear policy boundaries, test cross-tenant access, and avoid scattering authorization rules throughout controllers and components.
Plan for variation
Configuration, feature flags, integrations, and branded experiences need defined extension points. Without them, customer-specific requests quickly turn the core product into branches.