Architecture report

The multi-tenant SaaS architecture decision: cost & engineering hours across four patterns

The four mainstream multi-tenancy patterns scored on per-tenant cost, isolation strength, blast radius, and engineering hours to onboard. Three new metrics (TIC, AOC, BCM) sized against real workloads.

By RiteshMay 10, 202619 min read
Multi-tenant architecture cost study

TL;DR

  • Single-DB tenant_id is right for 80% of B2B SaaS at typical scale. $1,800 per 1k tenants/mo, 40 hours to onboard, fine isolation if RLS is correct. Almost everyone over-engineers past this.
  • Database-per-tenant breaks economically past ~5,000 tenants.The cost curve goes vertical. Outside compliance-heavy verticals (healthcare, finance, defence), it's the wrong default.
  • Onboard latency is the under-discussed cost. Schema-per-tenant takes ~1.8s to provision; database-per-tenant takes 5+. If sign-up flows are time-sensitive, this is the deciding factor.

Multi-tenancy decisions are easy to over-engineer because the failure mode of getting them wrong (data leaking between tenants) is catastrophic. The interesting question is which pattern actually fits the workload, most teams default to the most-isolated pattern they can afford, which is often two patterns more isolated than they need.

We compared the four mainstream patterns, single DB with tenant_id, schema-per-tenant, database-per-tenant, and sharded-by-region, across cost, isolation, onboard latency, and engineering hours to ship. Below.

The four patterns at a glance

PatternDescriptionTIC/1kAOC (hrs)BCMIsolationOnboard ms
Single DB, tenant_id columnRow-level isolation by tenant_id with RLS / app guards$1800407555200
Schema-per-tenantOne DB, one schema per tenant$620011050751,800
Database-per-tenantSeparate database / namespace per tenant$2400022018955,200
Sharded by regionTenants partitioned by region/cluster, multi-tenant within each shard$82003203580600

Finding 1: TIC ranges 13x across the four patterns

Chart 1: Tenant Isolation Cost (TIC) per pattern at 1,000 tenants

USD per 1,000 active tenants per month. Higher isolation = higher infrastructure spend.

PatternTIC/1k ($)AOC (hrs)BCMIsolationOnboard latency (ms)
Single DB, tenant_id column$1,800407555200
Schema-per-tenant$6,20011050751,800
Database-per-tenant$24,00022018955,200
Sharded by region$8,2003203580600

Sources: AWS RDS Postgres pricing; Neon and Supabase tenant pricing; CockroachDB and Postgres benchmarks; Appycodes implementation data across 14 multi-tenant builds.

Tenant Isolation Cost (TIC) per 1,000 tenants ranges from $1,800 (single DB, tenant_id) to $24,000 (database-per-tenant) at the 1k-tenant baseline. The range matters because it compounds, at 1k tenants the TIC delta is already $27k/mo, on the order of an additional engineer. Pick the wrong pattern early and the infrastructure bill funds a salary nobody plans for.

Finding 2: Cost scaling diverges sharply past 10k tenants

Chart 2: Cost scaling with tenant count

Y is monthly TIC ($), X is active tenants on a log scale. Database-per-tenant breaks down economically past ~5k tenants.

Active tenantsSingle DB / tenant_id ($)Schema-per-tenant ($)DB-per-tenant ($)Sharded by region ($)
100$1,800$6,200$24,000$8,200
500$1,900$6,500$26,000$8,400
1,000$2,200$7,200$29,500$8,800
5,000$3,400$11,500$56,000$11,800
10,000$5,200$18,000$110,000$16,500
50,000$14,000$62,000$510,000$48,000
100,000$27,000$118,000$1,080,000$88,000

Sources: AWS RDS Postgres pricing; Neon and Supabase tenant pricing; CockroachDB and Postgres benchmarks; Appycodes implementation data across 14 multi-tenant builds.

Read on log-log axes: the Single-DB pattern scales sub-linearly (cost per tenant goes down) because the underlying database has fixed overhead. Database-per-tenant scales super-linearly (cost goes up faster than tenant count) because each tenant gets its own running database. Past 10k tenants, the gap is 20x+. Past 100k it's 40x.

Finding 3: Blast-Radius is real and asymmetric

Chart 3: Blast-Radius Cost Multiplier (BCM) by pattern

Higher = a misbehaving tenant is more likely to impact others. Reads in dollars: how much it costs to contain a single bad tenant.

PatternBCMTIC/1k ($)AOC (hrs)IsolationOnboard latency (ms)
Single DB, tenant_id column75$1,8004055200
Schema-per-tenant50$6,200110751,800
Database-per-tenant18$24,000220955,200
Sharded by region35$8,20032080600

Sources: AWS RDS Postgres pricing; Neon and Supabase tenant pricing; CockroachDB and Postgres benchmarks; Appycodes implementation data across 14 multi-tenant builds.

The BCM score captures how much one bad tenant can affect others. Single-DB with tenant_id has the highest BCM (75) because a runaway query on a hot table affects everyone. Database-per-tenant has the lowest (18). The asymmetry: the BCM cost is paid only when something goes wrong; the TIC cost is paid every month.

How we compare the four patterns

1. Tenant Isolation Cost (TIC)

TIC = (Monthly infra cost / active tenants) x 1000

The core unit-economic number. Compute on observed infra spend and tenant count; compare against pattern benchmarks above.

2. Architecture Onboarding Cost (AOC)

AOC = Engineering hours to ship the multi-tenancy pattern from scratch

Includes schema design, RLS / policy setup, test coverage, observability for the chosen pattern, and tenant onboarding flow. Measured per pattern across our own implementations.

3. Blast-Radius Cost Multiplier (BCM)

BCM = Probability of cross-tenant impact x cost-of-impact

A risk-weighted cost. Multi-tenant SaaS in regulated verticals applies BCM as a hard floor, patterns above a threshold are rejected regardless of TIC.

What surprised us about tenant isolation in practice

  1. Most over-engineering happens at <1k tenants.Founders pick database-per-tenant because it "feels safer" before there's any reason to. The 100-tenant company on database-per-tenant is paying $24/mo per tenant in infra to isolate.
  2. Hybrid patterns work and almost nobody documents them. Single-DB with tenant_id for the bulk of the workload, schema-per-tenant for analytics-heavy tables, database-per-tenant for HIPAA-flagged tenants. Three of our highest-scale builds run this hybrid.
  3. Postgres RLS is dramatically more reliable than app-layer guards.The 5 tenant-leak incidents we've audited all happened on stacks that relied on the application to filter; none on stacks that used RLS as the floor.
  4. Schema-per-tenant runs out of room around 5k tenants on Postgres. Catalogue scans, migration time, and connection-pool fragmentation all degrade. Past that point you're moving to sharded-by-region whether you wanted to or not.
  5. Onboard latency over 3 seconds measurably hurts conversion.A/B testing across two of our SaaS clients showed sign-up completion drops 6-9% when the "creating your workspace" step exceeds 3s. Database-per-tenant pays this tax every signup.

Concretely, “single-DB with tenant_id and RLS as the floor” is short for the policy below. This is the minimum we deploy on a new Postgres-backed multi-tenant SaaS, the policy is the second line of defence after application-layer filtering, but it is the line that actually held up across the audits we ran.

Applied to every tenant-scoped table. Reads and writes are restricted to the tenant in the JWT claim that the API server sets via SET LOCAL on each request.

postgres / multi-tenant baseline RLS policysql
-- 1. enforce tenant_id on every table that holds tenant data
ALTER TABLE projects
  ADD COLUMN tenant_id uuid NOT NULL REFERENCES tenants(id);

CREATE INDEX projects_tenant_id_idx ON projects(tenant_id);

-- 2. turn RLS on, force it (so even the table owner is bound by it)
ALTER TABLE projects ENABLE ROW LEVEL SECURITY;
ALTER TABLE projects FORCE ROW LEVEL SECURITY;

-- 3. tenant scoping policy: rows must match the request's tenant
CREATE POLICY projects_tenant_isolation ON projects
  USING       (tenant_id = current_setting('app.current_tenant', true)::uuid)
  WITH CHECK  (tenant_id = current_setting('app.current_tenant', true)::uuid);

-- 4. the API server sets the tenant per-transaction from the verified JWT:
--    SET LOCAL app.current_tenant = '<tenant uuid from auth claim>';
--
-- 5. an integration test should attempt a cross-tenant read with tenant A's
--    session and assert zero rows. Run it on every PR.

Recommendations

For founders building a new SaaS

Default to single-DB with tenant_id on Postgres with RLS. Validate isolation with tests before launch. Plan to keep the pattern through ~10k tenants. Hybrid only when a real compliance or performance reason forces it. Our SaaS web app development engagement runs this pattern by default.

For founders building AI SaaS

AI features add an interesting wrinkle: tenant-context data shouldn't leak into model prompts across tenants. The cleanest pattern is single-DB tenant_id with tenant-scoped RAG indexes. We bake this into AI SaaS product developmentfrom day one, the alternative is a single embedding-store leak from one tenant's docs into another's completions.

For founders connecting multi-tenant data via APIs

Tenant scoping has to live at the API gateway layer, not just inside the application. We see this miss repeatedly: app code is tenant-aware, public APIs are not, and a single misconfigured token grants cross-tenant read access. The Series A codebase audit has the war stories, three of the 23 audited codebases had this exact failure mode in production. Our API & integration engagement covers exactly this surface, gateway-level tenant scoping, scoped tokens, and tenant-aware rate limits.

Limitations

Cost figures use AWS / GCP / Neon / Supabase pricing as of May 2026. Self-hosted setups will diverge, usually lower at scale, higher at small scale. Onboard latency numbers come from production telemetry on our own stacks.

How to choose the pattern in 30 minutes

The cost difference between "chose the right multi-tenant pattern" and "chose the safest-feeling one" is an entire engineer's salary at scale. Pick on the basis of TIC x tenant count five years out, not on the strength of the strongest-isolated alternative.

What multi-tenancy looks like at Series A, what an MVP build cost it, and the per-tenant token math for AI features:

The two engagements where this pattern is part of the architecture from sprint zero, plus the calculator that prices an architecture against your scope:

Frequently asked questions

Which multi-tenant architecture pattern is right for most B2B SaaS?
Single-DB with a tenant_id column and Postgres Row Level Security. $1,800 per 1,000 tenants per month at typical scale, 40 hours to onboard, and fine isolation if RLS is enforced. Almost every SaaS we audit has over-engineered past this pattern.
When should I move to schema-per-tenant or database-per-tenant?
Schema-per-tenant for analytics-heavy tables once a few large tenants represent disproportionate read volume. Database-per-tenant only for tenants under hard compliance constraints (HIPAA, sovereign data). Hybrid patterns, single-DB by default, with carved-out heavy or compliance-flagged tenants, are common and almost nobody documents them.
Why is application-layer tenant filtering risky?
Because a single missing WHERE clause leaks across tenants. The 5 tenant-leak incidents we have audited all happened on stacks that relied on the application to filter; none on stacks that used Postgres RLS as the floor. Defence-in-depth means both, with RLS as the guarantee.

The engagements this writing comes from

UK · Europe · Worldwide

selected work

Where these numbers came from

Production systems with the delivery figures attached.

Creoate product interface01
B2B commerce

The engineering partnership behind a cross-border wholesale marketplace.

Next.js storefront, Python ingestion pipelines, DynamoDB data layer and AWS infrastructure.

8+ yearsone team, still shipping
Ontick product interface02
Event technology

A commission-free ticketing platform built for ownership and scale.

Multi-organiser commerce, Stripe instalments and two native apps in one connected platform.

£2M+processed since launch
Easyship product interface03
Global logistics

Embedded product engineering for a global shipping platform.

Rate, tax and duty calculators, server-rendered courier pages and a custom MongoDB CMS.

550+couriers on the calculator
TEFL.ie product interface04
Education & training

A course-commerce and learning platform wired into one system.

WordPress and WooCommerce, a Moodle LMS, Stripe deposits and Zoho CRM, tied together with Zapier automation.

8 yrsengineer & run, since 2017
All White Laser product interface05
Medical aesthetics

A bespoke platform that finances aesthetic machines on Direct Debit.

A lead-to-billing system on GoCardless Direct Debit, provider certification, and a React Native app for machine owners.

9 yrsbuild & run, since 2017
Decofetch product interface06
Luxury commerce

A custom furniture marketplace engineered from storefront to infrastructure.

Server-rendered Next.js commerce over a Laravel API, bespoke operations tooling and re-architected AWS infrastructure.

0→livecustom, front to back
BA Engine Room product interface07
AI operations

An AI-native operating system that runs a consultancy lead to invoice.

Discovery briefs, e-signed contracts, Stripe deposits, delivery milestones and time tracking in one operational system.

0→1built from the ground up
PlusHeat product interface08
Home services

A conversion platform for a growing UK boiler-cover provider.

Custom plan configuration, postcode-qualified lead journeys, CRM synchronisation and campaign landing pages.

5 yrsweb partner since 2021
Léonia product interface09
Beauty commerce

A custom Shopify store for a French beauty brand.

Custom theme, customer accounts, loyalty rewards, referrals and gift-with-purchase offers.

5 yrspartners since 2021
Shutters 365 product interface10
Home improvement

Made-to-measure shutters with live pricing.

A seven-step product builder with live previews, sample orders and supplier tools.

7-stepconfigurator, live pricing
Bloc Ads Manager product interface11
Advertising

A self-service advertising platform for venues.

Campaign creation, audience targeting, in-app ads and reporting linked to venue check-ins.

check-insclosed-loop attribution
Bloc product interface12
Social events

An events app with the tools to run it.

Mobile app, backend, advertising tools, a digital marketplace and website.

4+ yrsone team, five codebases
Zonely product interface13
Social mobile

Two mobile apps for real-time companionship.

Customer and buddy apps with per-minute billing, wallets, moderation and admin tools.

2 appsconsumer + buddy, iOS & Android
Player Profile Hub product interface14
Grassroots football

Player profiles and discovery for youth football.

Verified profiles, video highlights, coach discovery and safeguarding on web and mobile.

0→1built from the ground up
DeepSpatial product interface15
Geospatial AI

Websites and a talent platform for DeepSpatial.

Corporate and investor pages, the Xploor talent platform and ongoing releases on AWS Amplify.

2 yrsone team, ongoing
Yippee Malta product interface16
Travel

Tour bookings with a custom mobile-first checkout.

A multilingual website connected to the booking API, with deposits, coupons and affiliate tracking.

90+core web vitals, mobile & desktop
Professional Energy product interface17
Energy brokerage

One platform for tenders, contracts and accounts.

Supplier tenders, contract management, brokerage accounting and client records.

100+suppliers in one tender

Tell us what you are trying to build.

A thirty-minute call with the engineer who would run it.

Book a call