Journal / SaaS Architecture and Scaling

SaaS Architecture and Scaling

Tenant Isolation: How Much Is Enough for B2B Customers

B2B customers want their data separated from other customers. Here is how to think about the right level of tenant isolation for your SaaS product.

Tenant Isolation: How Much Is Enough for B2B Customers

Tenant isolation is the degree to which a SaaS application separates one customer's data, processing, and infrastructure from another's. The spectrum runs from a shared database with row level filtering at the bottom to fully separate infrastructure per customer at the top. Most B2B SaaS products live somewhere in the middle. The right level depends on your customers' security requirements, compliance needs, and willingness to pay for dedicated resources.

What you need to know

  • Shared schema with row level security is sufficient for most SMB customers and early stage B2B SaaS products
  • Enterprise customers, particularly in regulated industries like healthcare, finance, and government, frequently require stronger isolation guarantees
  • Database per tenant or schema per tenant isolation is a significant increase in operational complexity that should only be adopted when enterprise requirements demand it
  • Fully separate infrastructure (VPC, compute, database per customer) is typically reserved for the top 5 percent of contracts and is priced accordingly
  • The marketing of "dedicated infrastructure" matters for enterprise sales even when the technical security difference is small

The core argument

The tenant isolation question is really three separate questions: data isolation, compute isolation, and network isolation. Most SaaS products need strong data isolation and do not need compute or network isolation except for a small number of high value customers. Conflating these three dimensions leads teams to either over engineer isolation for customers who do not require it, or under engineer it for customers who do.

Data isolation is the foundation. In a shared schema model, every table has a tenant_id column and every query filters by it. Row level security in PostgreSQL enforces this at the database level. This model scales well and provides strong data isolation when implemented correctly. The risk is bugs in the application layer that forget the tenant filter, which row level security catches. For 90 percent of B2B SaaS products at typical scale, this model is both sufficient and appropriate. The customers asking about it in security questionnaires are satisfied by a clear explanation of the RLS policy and a willingness to share the schema.

Schema per tenant isolation (one PostgreSQL schema per customer within the same database) adds a layer of separation that gives some customers more confidence, even though the practical security difference from row level security is modest. It makes tenant data more clearly delineated for compliance purposes, simplifies backup and restore for individual tenants, and is the first answer enterprise customers accept when they push back on shared schema. The operational cost is meaningful: connection pool management becomes more complex, schema migrations must be applied across every tenant schema, and the tooling for managing hundreds of schemas requires investment. I see schema per tenant as the right choice once you have more than 20 enterprise customers asking for it explicitly.

Common mistakes

  1. Defaulting to database per tenant before you have enterprise requirements. Separate databases multiply operational complexity. The connection pooling, backup management, migration tooling, and monitoring overhead is significant. Build it when a signed customer requires it, not as a speculative architectural decision.
  2. Not documenting your tenant isolation model for sales. Enterprise sales teams get asked "how is our data isolated?" on every security call. If your engineers cannot explain the isolation model in two sentences that a buyer with no technical background can follow, deals slow down. Write the explanation and put it in the security one pager.
  3. Building isolation features ahead of customer demand. Every hour spent building database per tenant infrastructure before any customer requires it is an hour not spent on features that acquire new customers. Build isolation in response to real requirements, not hypothetical ones.
  4. Offering single tenant deployment without pricing it correctly. Single tenant infrastructure for one customer is typically two to three times the operational cost of serving them on shared infrastructure. Price this correctly, or you will end up with customers on dedicated infrastructure who are unprofitable at your standard contract value.
  5. Not auditing your isolation level periodically. As the product evolves and features are added, new data access patterns emerge that may bypass existing isolation controls. Regular security reviews should include a check of tenant isolation in new and modified endpoints.

Where to start

Step 1: Implement shared schema with row level security correctly before thinking about stronger isolation. Get the fundamentals right. Every table has tenant_id. Every query is filtered. PostgreSQL RLS enforces this at the database level. Write cross tenant access tests. This handles most customers well.

Step 2: Prepare a clear tenant isolation explanation for your sales team. Write a one page document describing your isolation model. How is data separated? What prevents one customer from accessing another's data? What encryption is applied? This document lives in your security portal and is handed to enterprise prospects on the first security call.

Step 3: Build schema per tenant or database per tenant only when a specific customer requires it. When that customer arrives, understand their exact requirement, price the isolation cost into the contract, and implement it for their tenant only. Do not apply it retroactively to customers who do not need it.

FAQ

Frequently asked

  • What isolation level do SMB customers typically require?
  • When do enterprise customers start requiring database per tenant?
  • Is network isolation (separate VPCs) ever required?
  • How do I handle tenants with different isolation requirements in the same product?
  • Does tenant isolation affect performance?

Author

A note from Yashveer Singh

I am Yashveer Singh, founder of Yashveer Labs, and I do the work directly. No project manager, no account manager, no layer between you and the code. The engineer you talk to is the one writing it. If that sounds like the shape of project you have, we should talk.

Start the conversation See the work DM on Instagram