Multi-tenant SaaS architecture: the decisions that are expensive to reverse
Published 24 February 2026Updated 19 August 202610 min read
Decide four things before launch: isolation model (shared schema with row-level security, schema-per-tenant, or database-per-tenant), entitlement as configuration rather than code, a metering core recording usage per tenant and feature, and automated tests that fail the build if a query can cross a tenant boundary.
Choose an isolation model deliberately
Most products should start with shared schema and row-level security enforced at the database, not in application code. Enforcement in the application means one forgotten WHERE clause is a data breach.
- Shared schema with row-level security: best economics, requires disciplined policy testing.
- Schema per tenant: easier per-tenant operations, migration cost grows with tenant count.
- Database per tenant: strongest isolation story for enterprise buyers, highest operational overhead.
Entitlement belongs in data
Plans, features, and limits should be rows, not conditionals. When pricing is code, every packaging experiment becomes an engineering project and sales stops asking. When it is configuration, a new tier ships the same day.
Meter from day one
Even on flat pricing, record usage per tenant and feature. It is the input to pricing decisions, capacity planning, support triage, and churn prediction, and it is nearly impossible to reconstruct historically.
Implement soft limits with in-product warnings before hard enforcement. Customers forgive a limit; they do not forgive a silent cut-off.
Prove isolation with tests
- Generate policy tests per table and fail the build on any cross-tenant read or write.
- Include the admin and support paths — impersonation features are where isolation usually leaks.
- Log every cross-tenant administrative access with actor and reason.
Frequently asked questions
Is row-level security enough for multi-tenant isolation?
Yes when policies are enforced at the database and covered by automated tests that fail the build on any cross-tenant access. It is not enough if isolation depends on application code remembering to filter.
When should a SaaS move to database-per-tenant?
Usually when enterprise buyers require it contractually, or when a small number of very large tenants create noisy-neighbour problems. It is an answer to a commercial or performance requirement, not a default.
Should usage metering be built before usage-based pricing exists?
Yes. Metering data cannot be reconstructed after the fact, and it informs packaging, capacity, and support long before it drives an invoice.
Reviewable AI automation: shipping LLM features operations teams actually keep
Confidence gating, labelled evaluation sets, regression harnesses, decision logs, and reversibility — the engineering that separates durable AI automation from an abandoned pilot.
CRM to data warehouse: getting numbers your board will trust
Extraction patterns, slowly changing dimensions, metric ownership, freshness monitoring, and lineage when moving CRM data into Snowflake, BigQuery, or Postgres.