Multi-Tenant SaaS Architecture: Database Strategies, Scale and the Real Trade-Offs

Choosing your multi-tenancy strategy on day one shapes the next 5 years of your SaaS. The wrong choice surfaces as a 6-month migration project at the moment your sales team can least afford one. This guide is an opinionated walk-through of the three main strategies (shared database, schema-per-tenant, database-per-tenant) with the performance numbers, isolation guarantees and migration paths we use at Alher Tech to architect SaaS that scales.

The Three Strategies

When Each Wins

Performance Numbers (PostgreSQL, 2026)

Real numbers from production systems we've shipped. Your mileage will vary but these are the order-of-magnitude bounds:

StrategyPractical tenant ceilingPer-tenant migrationBackup granularity
Row-level (shared)~5,000 tenants per clusterSingle transaction, all tenantsAll-or-nothing
Schema-per-tenant~3,000 schemas per DBPer-tenant via search_pathPer-schema dump possible
DB-per-tenant~200-500 DBs per cluster, then shardPer-DBPer-DB at any time

Shared row-level can scale further with sharding, but you cross a complexity threshold at ~5K tenants where schema-per-tenant becomes simpler operationally.

Isolation: What Each Actually Guarantees

The Migration Trap

If you start with row-level and grow past 1,000 tenants with one or two enterprise customers asking for data residency, you'll need to migrate. The migration costs:

If you have any indication that enterprise customers will demand isolation, start with schema-per-tenant from day one. The marginal complexity is small; the migration cost later is enormous.

Practical Architecture for B2B SaaS

The architecture we default to in 2026 for B2B SaaS:

Common Mistakes

Choose for the Customer Profile, Not the Demo

Multi-tenancy is the most architecturally consequential decision in a SaaS. Pick based on the customers you'll actually serve, including the enterprise ones two years out.

Schema-per-tenant on PostgreSQL is the right answer for most B2B SaaS in 2026. Default there unless you have specific reasons to go either lower (early-stage SMB) or higher (regulated enterprise).

Frequently asked questions

Should I start with DB-per-tenant?

Only if your first customers are regulated enterprises (HIPAA, banking, defense). Otherwise the ops overhead delays product delivery for benefits you may never need.

Is schema-per-tenant Postgres-only?

Best supported on PostgreSQL. MySQL has limited schema support. SQL Server does it well. NoSQL stores (Mongo, Dynamo) handle multi-tenancy differently, typically per-collection or per-table.

How many schemas can PostgreSQL handle?

Practical ceiling is 3-5K schemas before pg_class queries slow noticeably. Some teams run 10K+ with careful tuning. Past that, shard schemas across multiple databases.

What about Row-Level Security?

Use it as a defense in depth on shared tables, not as your primary isolation mechanism. It's a safety net for human error, not the architecture itself.

Can I migrate from row-level to schema-per-tenant later?

Yes, but it's a 6-month project costing $200K-$800K depending on size. If there's a 30%+ chance you'll need to, start with schema-per-tenant.

Related guides