SaaS

Multi-tenant SaaS architecture: the decisions that are expensive to change later

A multi-tenant SaaS application serves many customers from one codebase and deployment, keeping each customer’s data separate. It sounds like a technical detail. It is actually the single most consequential architectural decision in a subscription product, because retrofitting it later is slow, risky and expensive.

What multi-tenancy actually means

A tenant is a customer organisation — a company, a clinic, an institute. Multi-tenancy means those tenants share the same application and infrastructure, while each sees only its own users, records and settings.

The alternative is single-tenancy: a separate copy of the application per customer. That is simpler to reason about and sometimes required, but costs far more to operate as customers grow, because every deployment must be updated, monitored and backed up individually.

The three common tenancy models

Most SaaS products land on one of three approaches, and the right choice depends on scale, compliance and customer expectations.

  • Shared database, shared schema. All tenants’ data lives in the same tables, distinguished by a tenant identifier on every row. Cheapest to run and simplest to update; requires rigorous scoping so queries never cross tenants.
  • Shared database, separate schemas. Each tenant has its own set of tables in one database. Stronger separation, more operational overhead, and migrations must run for every schema.
  • Separate database per tenant. The strongest isolation, useful for enterprise or regulated customers. Highest operating cost and complexity.

Data isolation is a design problem, not a discipline problem

In a shared-schema model, every query must be scoped to the current tenant. If that depends on each developer remembering to add a filter, a leak is eventually inevitable — one forgotten condition and one customer sees another’s data.

The safer approach is to enforce scoping centrally: at the data access layer, through default query scopes, or through database-level row security. Then write tests that deliberately try to cross tenants and confirm they fail.

Identity, roles and permissions

Users belong to tenants, and within a tenant they hold roles. Define a permission matrix early — which roles can view, create, edit, approve and delete each type of record — and enforce it in one place.

Plan for invitations, deactivation and transfer of ownership from the start. Customers will hire, fire and reorganise, and a product that requires a support ticket to add a user does not scale.

Billing is a state machine

Subscription billing looks simple until real customers arrive. Trials expire, cards fail, plans change mid-cycle, invoices need tax details, and customers cancel and return.

Model the subscription as a set of states — trialing, active, past due, cancelled, reactivated — driven by payment provider webhooks, and derive feature access from the state and plan. Never rely on a manually edited flag that someone forgets to update.

Operator tooling you will need on day one

The people running the product need tools the customers never see: search across tenants, the ability to view the product as a customer sees it with an audit trail, plan changes, trial extensions, data exports and error visibility.

Without those, every support question becomes a developer request, and the cost of serving each additional customer stays stubbornly high.

A sensible order of work

  1. Define the smallest release a customer would pay for, and what is explicitly deferred.
  2. Design the tenancy model, permission matrix and billing lifecycle on paper.
  3. Build authentication, tenancy, roles, subscription state and the admin panel first.
  4. Build the core product features in short cycles against those foundations.
  5. Launch to a small set of real customers and let their usage shape the roadmap.

When not to build multi-tenant

If you are building software for exactly one organisation, multi-tenancy is unnecessary complexity. A single-tenant application is faster to build and simpler to secure. The mistake is choosing single-tenant because it is easier while intending to sell to many customers later.

Frequently asked questions

Which tenancy model should a new SaaS product use?

For most products, shared database with shared schema and strict central scoping is the right starting point: cheapest to run and easiest to update. Move to stronger isolation for specific customers only if compliance or contracts require it.

Can we add multi-tenancy later?

Technically yes, practically it is one of the most expensive retrofits, because tenant identity touches almost every table, query and permission check. It is far cheaper to design in from the beginning.

How do we handle customers who want their own domain?

Custom domains and subdomains are usually resolved to a tenant at the routing layer. It is a well-understood pattern, best planned early because it affects authentication and email links.

What about data residency and compliance?

Where a customer requires data in a specific region or in a dedicated database, a hybrid approach — shared by default, isolated on request — is common.

Next step

Planning a subscription product? Our SaaS development service covers architecture, billing, roles and admin tooling, and you can send us a brief to scope a first release.

Keep reading

Related articles

Next step

Want this applied to your business?

Reading about it is one thing. If you want to know what it would take in your specific situation, send us a short brief.

Start Your Project WhatsApp