Start a Project

SaaS Engineering

118 min read·May 2025

SaaS Multi-Tenancy: The Architecture Decisions That Compound

Multi-tenancy is the defining architectural challenge of SaaS development. The decisions made during initial architecture — how tenant data is isolated, how tenant-specific configuration is managed, how the system scales with tenant load — determine the operational cost, compliance posture, and scaling ceiling of the platform for its entire commercial life. These decisions are made under time pressure at the beginning of the product's life, when the team has the least information about how the product will be used at scale. Getting them wrong creates constraints that compound with every customer added.

SV

P Sai Vignesh

Founder & Director · IDEANEST X PRIVATE LIMITED

01

Tenant Isolation: Three Strategies with Different Trade-offs

The three primary multi-tenancy data isolation strategies each make a different trade-off between cost, isolation strength, and operational complexity. Shared database with a shared schema uses a single database with a tenant identifier on every row. It is the cheapest to operate at low tenant counts and the most complex to make compliant at high ones — demonstrating that one tenant's data cannot be accessed by another requires application-level controls that must be maintained and audited throughout the codebase.

Shared database with separate schemas per tenant provides stronger logical isolation with lower infrastructure cost than database-per-tenant, but creates schema migration complexity that grows with tenant count. A schema change must be applied to every tenant schema — a migration that runs in seconds on a shared schema can take hours when applied to thousands of tenant schemas sequentially. Schema migration strategy must be designed before the first tenant schema is created, not after the tenant count makes sequential migration operationally painful.

  • Shared schema: lowest cost, weakest isolation, highest compliance audit complexity
  • Separate schemas: moderate cost, moderate isolation, migration complexity scales with tenant count
  • Database per tenant: highest infrastructure cost, strongest isolation, simplest compliance posture
  • Hybrid: enterprise customers on dedicated infrastructure, SMB customers on shared — adds operational complexity but optimises for commercial requirements
02

Tenant Configuration and Customisation

Architecture Risk

Tenant configuration that starts as a handful of flags becomes, over time, a configuration system complex enough to require dedicated engineering to maintain. Designing the configuration model before it is needed prevents this accumulation.

Every SaaS product acquires tenant-specific configuration: feature flags, limits, custom domain settings, branding, third-party integration credentials, notification preferences. Each addition to the configuration surface was individually reasonable. The accumulated configuration system that results is often not. Configuration that was stored in environment variables is moved to a database. Configuration that was in the database is promoted to a UI. The schema for configuration grows organically to accommodate new requirements without a model that constrains what can be configured and how.

The architectural response is to design the configuration model as a first-class system early — before the configuration surface is large enough that a model constraint feels unnecessary. This means defining what categories of configuration exist, how they are versioned, how they interact with feature flag systems, and how they are observable in production. A configuration change that cannot be traced to the tenant, the actor, and the time of change is an operational risk in a system where configuration errors affect customer-visible behaviour.

03

The Noisy Neighbour Problem

A tenant that generates ten times the expected load must be containable without degrading the experience for other tenants. This is a design requirement, not an operational response.

In a shared infrastructure SaaS platform, a single tenant that generates unusually high load — through legitimate high usage, through a runaway automated process, or through a misconfigured integration — can degrade the experience of all other tenants sharing the same infrastructure. This is the noisy neighbour problem, and it is a predictable consequence of resource sharing without isolation controls.

The technical controls are established: per-tenant rate limiting on API endpoints, per-tenant job queue prioritisation, per-tenant database query timeouts and resource limits. The operational challenge is implementing these controls before the first noisy neighbour incident, at a point when they seem like premature optimisation. Teams that implement tenant isolation controls after the first incident that warrants them are doing so reactively, under operational pressure, with a degraded service affecting customers.

04

Designing the Migration Path

SaaS platforms change their tenancy model as the business evolves. A product that started with a shared-schema approach may need to migrate enterprise customers to dedicated infrastructure as their compliance requirements become more demanding. A product that started with database-per-tenant may need to move to a shared model as the tenant count grows and per-tenant infrastructure costs become commercially unsustainable at the pricing the market will accept.

The migration path between tenancy models is expensive and carries significant operational risk. It requires moving production customer data, updating application code, and maintaining service continuity throughout. The cost of this migration is determined by decisions made at the start of the platform's life: how data is structured, how tenant identifiers are referenced throughout the codebase, how the migration can be executed incrementally without requiring a single large-batch operation. The teams that design for migration from the start pay a small upfront cost. The teams that do not discover the full cost later.