Skip to main content
webburrito

SaaS Multi-Tenancy Explained: Three Models, Visually

SaaSArchitectureDatabasesSecurityWeb Development
10 Nov 2026 | By Tom Kiernan | 7 min read

Every SaaS product has to answer one question early: when two customers use the same app, where does each one's data live?

That's multi-tenancy. Each customer is a "tenant", and the model you pick shapes your hosting bill, your security story and how painful your tenth enterprise deal will be.

There are three common answers. Switch between them below.

Three ways to house your customers' data

Switch between models, then pick a customer to see where their data lives.

Follow:

One database, shared tables

Every customer's rows sit in the same tables, told apart by a tenant_id column.

Data isolation2/5
Cost efficiency5/5
Simple to run5/5
Per-customer flexibility1/5

Ratings are rules of thumb, not measurements.

Best for
Lots of small customers, self-serve sign-up, keeping costs low.
Watch out for
One missed tenant filter leaks data, and one heavy customer can slow everyone down.

Model 1: shared tables

All customers share one database and one set of tables. Every row carries a tenant_id, and every query filters on it.

It's the cheapest model to run and the simplest to operate. One migration updates everyone. A new customer is a new row, not new infrastructure.

The risk is that isolation lives in your code. One query without the tenant filter shows a customer somebody else's data. Two habits reduce that risk:

  • Apply the tenant filter in one central place, so individual queries can't forget it.
  • Add a second line of defence in the database itself. PostgreSQL's row-level security can refuse to return rows that belong to another tenant, even when the application gets it wrong.

Model 2: schema per tenant

Customers share a database server, but each gets their own schema: a private copy of every table.

Separation is clearer. A query in one schema can't accidentally read another, and exporting or deleting one customer's data is straightforward.

The cost shows up at migration time. A change to one table is now a change to that table in every schema, and a migration that fails halfway leaves customers on different versions. That's manageable with good tooling for a few hundred tenants and awkward for tens of thousands.

Model 3: database per tenant

Each customer gets a database of their own, sometimes on separate hardware or in a specific region.

This gives the strongest isolation. A busy customer can't slow the others down, you can back up and restore one customer without touching anyone else, and you can keep a customer's data in the country their contract requires.

You pay for that in money and effort. Every customer adds infrastructure to provision, monitor, patch and migrate.

How to choose

Five questions settle most cases.

  1. How many customers, and how big? Thousands of small accounts point to shared tables. A handful of large ones point towards separate databases.
  2. What do your contracts and regulators require? If customers ask where their data sits and who else shares the server, you need an answer they'll accept.
  3. Will a customer ever need their data restored on its own? That's simple with a database each and fiddly with shared tables.
  4. Could one customer's workload hurt the others? Heavy reporting or bulk imports are the usual culprits.
  5. How much operations work can your team absorb? The most isolated model is no use if nobody has time to run it.

You can mix them

Plenty of products run more than one model at once. Most customers live in shared tables, and the few who need it, or pay for it, get a database of their own.

That only works if the application has a single place that decides "which tenant is this request for, and where is their data?" Build that seam from the start, even if every tenant resolves to the same database on day one. Moving a customer later then becomes a data migration instead of a rewrite.

The parts people forget

The database is only one place tenant data lives. The same boundary has to hold in:

  • Background jobs, which run without a logged-in user to take the tenant from
  • Caches, where a key without the tenant in it serves one customer's data to another
  • File storage, including uploads, exports and generated reports
  • Search indexes
  • Logs and analytics

A model that's watertight in the database and leaky in the cache is still leaky.

Where to start

If you're pre-launch with no enterprise customers lined up, shared tables with central tenant scoping and row-level security is a sound default, and it leaves the door open to the other two. If you already know your buyers will ask for isolation in writing, design for it now.

Either way, it's far cheaper to get right before there's data in it. If you'd like a second opinion on which model fits, that's part of our SaaS development work.

Related Articles