Start with the access boundary

A multi-tenant product lets several businesses use one application. That does not mean their data can share the same access rules. Start by documenting who belongs to each account, how account switching works and which operations are reserved for staff. A tenant identifier supplied by a browser should never be treated as sufficient authorization.

Trace every entry point

Review more than controller queries. Background jobs, exported files, cache keys, attachment links and support tools can all cross the tenant boundary. For each path, ask where tenant context comes from and how access is checked. A report that runs correctly for one account is not evidence that it is isolated from another.

Choose storage around operational needs

Shared tables, separate schemas and separate databases create different operational tradeoffs. Compare how each option affects migrations, backups, recovery and support. The most appropriate choice depends on the product and the team responsible for operating it. Write down those tradeoffs before committing to a tenancy library.

Test with two accounts

Use two accounts with deliberately similar records. Check that searching, downloading and changing identifiers cannot reveal the other account’s data. Repeat those checks for queued work and staff actions. Include a user who belongs to both accounts so switching behavior is exercised.

Make the boundary visible

Keep tenant context in diagnostic information without exposing private customer data. When reviewing a new feature, name the tenant boundary alongside the business requirement. Our recommended starting point is a map of access paths, followed by focused checks on the paths with the greatest consequences.