SaaS Engineering

Multi-Tenant Architecture: Shared Schema vs Isolated Database, and When to Switch

The shared-schema-with-a-tenant-id approach that got you to your first hundred customers is not the same decision as your thousandth. Here is how we decide.

Nov 6, 20259 min readOmelatte AI Team
Multi-tenancyArchitectureDatabase

Almost every SaaS platform starts with a shared database and a `tenant_id` column on every table, and for good reason — it is the fastest path to a working product and the easiest to operate with a small team. The mistake is treating that as a permanent architectural decision instead of the correct decision for a specific stage of the business.

The three models, honestly compared

  • Shared schema, shared database — fastest to build and cheapest to run; the weakest isolation, entirely dependent on disciplined query-layer enforcement of tenant_id everywhere.
  • Schema-per-tenant, shared database — better isolation and easier per-tenant customization; migrations become an operation you run across hundreds of schemas instead of one.
  • Database-per-tenant — the strongest isolation and the easiest "delete this customer's data" story for compliance; the most expensive to operate and the hardest to run cross-tenant analytics against.

There is no universally correct answer here — there is a correct answer for your compliance requirements, your customer size profile, and your team's operational capacity. A platform selling to five enterprise healthcare customers has a very different answer than one selling to five thousand small businesses.

The signal that tells you it is time to reconsider

The trigger is rarely "we have grown." It is usually a specific enterprise requirement: a customer's security review demands physical data isolation, or a compliance framework requires the ability to fully delete one tenant's data on a defined timeline in a way your shared schema cannot cleanly guarantee. That single deal-blocking requirement is worth acting on immediately — general unease about scale is not.

Enforce isolation in one place, not everywhere

Whichever model you choose, tenant isolation belongs in a single, heavily tested layer — a query builder, an ORM middleware, a database policy — never in the discipline of every engineer remembering to add a `WHERE tenant_id = ?` clause by hand. We have inherited more than one codebase where a single missed clause in a rarely-touched report endpoint leaked one customer's data into another's export. That bug class should be architecturally impossible, not merely discouraged in a code review comment.

More on saas engineering

Related reading.

More from the same category.

Have a build that needs
this kind of thinking?

Thirty minutes with the people who would actually do the work — no discovery deck, no account manager.