Tenant isolation
What a tenant is
A tenant is a customer organization or other logical group whose data and administration must remain separated according to the service policy. A shared bookstore service hosts shops Cedar and Maple. Each shop can have multiple users. A signed-in user in Cedar is not automatically entitled to Maple records.
Membership and record scope
Suppose user Sara belongs to Cedar, and both shops have an invoice numbered 17. The application resolves the authorized tenant from trusted membership data and identifies the invoice within that tenant. The pair (Cedar, 17) is distinct from (Maple, 17). A matching invoice number alone is insufficient. Membership in multiple shops requires an explicit validated selection.
Isolation beyond the query
Isolation must cover reads, writes, lists, search results, background jobs and generated reports. A list endpoint that returns only Cedar records is useful, but a separate export job must also enforce the same boundary. A tenant administrator manages that tenant under policy, not the whole platform.
Storage design choices
Shared tables with tenant-scoped access, separate schemas and separate databases offer different isolation and operational trade-offs. Data-layer constraints or policies can provide an additional protection layer if the selected database supports them and they are configured correctly. No storage layout replaces application authorization. Verify backup, restoration and reporting boundaries too.
Practice: review a fictional export
An export design selects records by invoice number but does not establish tenant membership. Identify the missing requirement. Specify a valid Cedar export, a denied Maple export for Sara and an empty-result case. Verify that every returned row belongs to the selected authorized tenant. Source: OWASP Multi-Tenant Application Security Cheat Sheet.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Tenant isolation — knowledge check
Apply authorization concepts to fictional bookstore records.
What is a tenant in this example?
Both shops have invoice 17. What distinguishes them?
Sara belongs only to Cedar. May she export Maple records?
Which other operation needs tenant isolation?
What does a separate database establish by itself?