New: outcomized services. Pay per result, with a monthly cap you set. See pricing →
Engineering

What is Multi-Tenancy?

Multi-Tenancy: An architecture where one application serves many customer accounts (tenants) from shared infrastructure while keeping each tenant's data isolated.

In a multi-tenant system, every customer uses the same running application and usually the same database, but each sees only its own data. Isolation can be done at different levels: a tenant ID column on every row enforced by the application or by database row-level security, a separate schema per tenant, or a separate database per tenant. Each step up in isolation costs more to run and operate.

Multi-tenancy affects much more than the database: file storage paths, search and vector indexes, caches, background jobs, rate limits, billing, and logs all need to know which tenant they belong to. AI features add new places for leaks, such as a retrieval index that does not filter by tenant or a prompt cache shared across accounts.

Why it matters when you build or buy AI

Cross-tenant data leaks are among the most damaging bugs a SaaS product can have, and they are common in fast-built apps. Decide on your tenancy model before you have customers, enforce it as close to the database as possible (row-level security is a strong default), and test it explicitly by trying to read one tenant's data as another.

Example

A B2B SaaS uses Postgres row-level security keyed on tenant ID, so even a buggy query in the app cannot return another customer's invoices.

Need senior engineering leadership?Architecture, review, and hands-on building by the month.

Related terms

More in Engineering

Next step

Book 20 minutes, or send a brief

A former CTO replies. You leave with a written plan and a fixed estimate.

No spam. One reply within one business day. Or skip the form and book a call.

Thank you. Your brief is on its way. Grab a time now so we can talk it through.

Prefer LinkedIn? Connect with Harish.

Book a callFree lead test