Pick the isolation model
Shared, schema-per-tenant, or database-per-tenant, chosen against your real isolation, scale, and cost needs. This decision drives everything else.
How you isolate tenants is the single hardest thing to change later. We choose the model deliberately, enforce it at the data layer, and make it impossible for one customer to see another's data.
Multi-tenancy is a spectrum: shared tables with a tenant id, schema per tenant, or database per tenant. Each trades isolation against operational cost, and migrating between them after launch is brutal. We pick the right point for your security and scale needs, then enforce isolation in code and at the database so a leak is structurally impossible, not just unlikely.
Shared, schema-per-tenant, or database-per-tenant, chosen against your real isolation, scale, and cost needs. This decision drives everything else.
Tenant scoping is enforced in the query layer and, where it fits, with row-level security. Application bugs cannot cross tenants.
Auth, billing, rate limits, and background jobs all carry tenant context. No global job leaks data across customers.
Automated tests that actively try to read across tenants and must fail. Isolation is proven, not assumed.