Start a project

Let’s build something that works

The first conversation is free, you’ll leave with clarity, not a sales pitch.

or email hello@zentury.studio

We’ll only use your details to reply to you. See our Privacy Policy.

HomeInsightsTechnology

Multi-Tenant SaaS Architecture: Models, Isolation and Scaling

Compare shared schema, schema per tenant, database per tenant and hybrid models, with practical guidance on isolation, onboarding, noisy neighbours, backups and billing.

Zentury team9 min read
Diagram of several customer tenants sharing one SaaS application with separate data stores

Multi-tenant SaaS architecture means one running application serves many customers (tenants) while keeping each tenant’s data and behaviour separate. The core decision is how much you share: one database with a tenant column, a schema per tenant, a database per tenant, or a mix. Most products start shared and add stronger isolation only for customers who need it.

This guide covers tenancy models, isolation, data modelling, onboarding, customisation, scaling, backups, billing and how to choose. For the wider path from idea to launch, see our SaaS development guide.

The short answer

Start with the simplest model that meets your isolation and compliance needs, and design so individual tenants can move to stronger isolation later.

  • Shared schema suits most early products and keeps operations light.
  • Schema per tenant suits mid-sized tenants who need cleaner separation.
  • Database per tenant suits regulated or enterprise customers who need hard isolation.
  • Hybrid suits a broad base of small tenants plus a few large or regulated ones.

Whatever you pick, carry the tenant identity through your code from the first commit. Retrofitting it later is the expensive part.

What multi-tenancy changes

In a single-tenant system, each customer gets their own copy of the application. In a multi-tenant system, customers share it, and the software decides which data and settings apply to each request.

That moves isolation from infrastructure into your code and data design. A missed filter or a badly scoped cache key can show one customer’s data to another. A tenant is usually an organisation with many users and roles, so model it as its own concept instead of treating a user account as the boundary.

The four tenancy models

Shared database, shared schema

All tenants live in the same tables, and every row carries a tenant identifier that queries always filter on.

This is the cheapest model to run, deploy and monitor, and one schema change reaches everyone at once. The weaknesses are that isolation depends entirely on correct filtering, heavy tenants can affect others, and restoring a single tenant is awkward.

Schema per tenant

Each tenant gets its own schema (a named set of tables) inside a shared database, and the application selects the right one per request.

This gives clearer separation and easier per-tenant export. The cost is operational: migrations must run across every schema, and a very large number of schemas can strain tooling. It works best with fewer, larger tenants.

Database per tenant

Each tenant gets a dedicated database, sometimes with dedicated compute.

This offers the strongest isolation, independent restores, per-tenant encryption keys and a clean data residency story. It also costs the most to run. Migrations, monitoring and connection management multiply with every tenant, so automation is essential.

Hybrid

Small tenants share a pool, while larger or regulated tenants get dedicated schemas or databases. A routing layer looks up where each tenant lives and directs requests there.

Hybrid gives commercial flexibility, since stronger isolation can be a premium tier. It also means your code must work against more than one layout, so build the routing layer early even if every tenant starts in the same pool.

Comparing the models

Factor Shared schema Schema per tenant Database per tenant Hybrid
Isolation strength Logical only Moderate Strongest Varies by tenant
Running cost Lowest Low to moderate Highest Moderate
Operational effort Lowest Moderate Highest Moderate to high
Per-tenant restore Hard Possible Straightforward Depends on tier
Noisy neighbour risk Highest Moderate Lowest Controlled by tier
Best fit Early products, many small tenants Mid-sized tenants Regulated or enterprise tenants Mixed customer base

Isolation and security

Treat tenant isolation as a security control. The goal is that no request can read or change another tenant’s data, even when a developer makes a mistake.

  • Resolve the tenant once, early. Take it from the subdomain, token or session, and never trust a tenant identifier from user input without checking it against the user’s memberships.
  • Enforce at the data layer. In shared-schema designs, row-level security can apply the tenant filter automatically, so a forgotten filter does not leak data.
  • Scope everything else. Caches, search indexes, file paths, job queues, logs and email templates all need the tenant in their keys.
  • Test isolation directly. Create two tenants in automated tests and confirm one cannot reach the other’s records through any endpoint, export or background job.
  • Audit internal access. Support staff who can view tenant data need logged, time-limited access.

For wider practices on authentication, secrets and dependencies, see our guide to app security best practices.

Data modelling for tenants

Good modelling makes isolation the default. Put a tenant identifier on every table holding customer data, and include it in indexes so scoped queries stay fast.

  • Composite uniqueness. An invoice number or username is usually unique within a tenant, not globally.
  • Tenant-aware foreign keys. Where possible, let relationships carry the tenant identifier so the database rejects links across tenants.
  • Shared reference data. Decide which data is global (plan definitions, templates) and which belongs to a tenant, and keep the rule consistent.
  • Opaque identifiers. Sequential identifiers reveal record counts and invite guessing, so random identifiers are safer in URLs and APIs.

Your database and framework choices shape all of this. Our guide on how to choose a tech stack covers that trade-off.

Tenant onboarding

A new tenant should be created by a repeatable, automated process, not by an engineer running scripts. A typical flow:

  1. Create the tenant record and owner account.
  2. Provision storage in the right place: rows, a schema or a database.
  3. Seed default settings, roles and sample content.
  4. Apply the plan and its limits.
  5. Record the event for audit and billing.

Make the process idempotent, meaning it can be retried after a failure without creating duplicates. Where provisioning is slow, as it can be with database per tenant, run it as a background job and show clear progress. Plan offboarding too: data export, a grace period and verified deletion.

Customisation without forking

Tenants will ask for branding, workflows, fields and integrations. In a shared codebase, serve them through configuration, not custom code branches.

  • Per-tenant settings and feature flags change behaviour without a separate deployment.
  • Custom fields in a validated structure let tenants extend records without altering the shared schema.
  • Theming through logos, colours and domains is applied at render time.
  • Webhooks and APIs let tenants connect their own tools.

Resist one-off code paths for a single customer, because each multiplies testing effort. If a request is common, make it a configurable feature for everyone.

Scaling and noisy neighbours

A noisy neighbour is a tenant whose heavy usage slows others who share the same resources. It is the signature operational risk of multi-tenancy.

  • Quotas and rate limits per tenant for API calls, uploads, exports and expensive reports.
  • Fair scheduling in job queues, so one large batch does not occupy every worker.
  • Query discipline: tenant-scoped indexes, pagination and limits on unbounded queries.
  • Per-tenant observability for load, errors and latency, so you can see who affects whom.
  • Relocation. In a hybrid design, moving a heavy tenant to dedicated resources is often the cleanest fix.

The database is usually the hardest part to scale. Read replicas, caching and later partitioning can extend a shared database a long way, and the tenant identifier is a natural partition key.

Backups, restores and compliance

Backup strategy follows the tenancy model. With database per tenant, restoring one customer is routine. With a shared schema, it usually means extracting their rows from a backup into a temporary environment and merging carefully. If customers expect self-service restore, let that influence your choice early.

Compliance often decides the model for you:

  • Data residency: tenants who must keep data in a region need placement control, which favours hybrid or regional deployments.
  • Encryption keys: customer-managed keys are far easier with separate databases.
  • Audit trails: log who accessed or changed tenant data, with tenant-aware records.
  • Deletion requests: you need a reliable way to remove all of a tenant’s data, including caches, indexes, logs and backups, within the retention rules that apply.

Confirm the regulations and contract terms for your market with a qualified adviser. This article describes architecture, not legal requirements.

Billing should attach to the tenant, not an individual user. The tenant record holds the plan, subscription status, limits and the link to the payment provider’s customer record.

  • Entitlements in one layer. Map each plan to features and limits, and check them in one place instead of scattering plan checks through the code.
  • Idempotent webhooks. Process renewals, failures and cancellations from your payment provider safely, and tie them to the tenant by a stored customer identifier.
  • Usage metering. If you charge by usage, record events per tenant reliably and reconcile before invoicing.
  • Explicit states. Define what a failed payment does: grace period, read-only mode, then suspension.

How to choose a tenancy model

Work through these questions in order and stop when one gives a clear answer.

  1. Do target customers require hard isolation, their own keys or specific regions? If yes, plan for database per tenant or a hybrid with a dedicated tier.
  2. How many tenants, and how large? Many small tenants favour a shared schema. A few large ones can justify more isolation.
  3. How much operational capacity does your team have? More databases means more automation and migration tooling.
  4. Do customers need self-service restore or export? If so, favour models where one tenant’s data is easy to separate.
  5. Are you still validating the product? Start shared, enforce tenant scoping rigorously and keep a routing layer ready.

If answers conflict, favour the choice that is hardest to reverse. Adding isolation later is feasible when code already respects tenant boundaries, while unwinding a sprawl of databases is much harder.

Need help with your architecture?

If you are planning a multi-tenant product and want a second opinion on tenancy, data design or security, talk to our team. We can review your requirements and outline an approach as part of web app development.

Frequently asked questions

01What is multi-tenant SaaS architecture?

It is a design where one application serves many customers, with each tenant's data and settings kept separate. The application identifies the tenant on every request and applies the right data, permissions and configuration.

02Which tenancy model should a new product start with?

Usually a shared database and schema with strict tenant scoping, unless early customers require hard isolation. It is the simplest to build and run. Keep tenant identity explicit everywhere so a later move stays possible.

03Is multi-tenancy less secure than single-tenant?

Not inherently, but the risk differs. Isolation depends on your code and data design instead of physical separation, so mistakes can have wider impact. Row-level security, tenant-aware caching and isolation tests reduce that risk.

04How do you stop one tenant slowing down others?

Apply per-tenant quotas, schedule jobs fairly, keep queries indexed and bounded, and monitor load by tenant. If one tenant still dominates, move them to dedicated resources.

05Can a tenant move from shared to dedicated infrastructure later?

Yes, if you planned for it. You need a routing layer, a tested data migration process and code that does not assume one shared database. Without those, it becomes a major project.

06Should billing be tied to users or tenants?

Tenants. The tenant holds the plan, limits and payment customer record, while users belong to it.

Work with us

Have a project in mind? Let’s talk it through.

Tell us what you’re building. The first conversation is free, and you’ll leave with a clear next step.

Start your project

Keep reading

All insights

09 · Get in touch

Let’s build

Let’s Build Something That Works

Have an idea you’re ready to move on? A problem your current technology isn’t solving? Our team is based in Austin, Texas, and works with businesses all over the world. Reach out: the first conversation is free, and you’ll leave with clarity, not a sales pitch.

Email us
Studio
5900 Balcones Drive STE 100, Austin, Texas 78731

Tell us about your project

We’ll only use your details to reply to you. See our Privacy Policy.