Skip to content
Architecture20 Jul 202610 min read

Multi-tenant Laravel: the three models and when each breaks

Shared schema, schema per tenant, database per tenant. Each is correct somewhere, and each has a failure mode that arrives at a predictable scale.

NB

Nadia Benali

Head of Web Practice

Shared schema with a tenant column

The cheapest option and the right default below roughly 500 tenants. One database, one schema, a tenant_id on every table and a global scope that applies it.

Where it breaks: a single tenant with 40× the data of everyone else. Index selectivity collapses, and one customer's report starves everybody's queries. Also: one forgotten withoutGlobalScope is a data breach.

Schema per tenant

One database server, one schema per tenant. Isolation is structural rather than conditional, and per-tenant backup and restore become trivial.

Where it breaks: migrations. Running a schema change across 3,000 schemas takes hours and fails partway through often enough that you need a migration orchestrator with resume capability.

Database per tenant

Full isolation, per-tenant scaling, straightforward data residency. This is what regulated customers ask for by name.

Where it breaks: cost and connection pooling. A thousand tenants means a thousand connection pools, and cross-tenant analytics requires a separate warehouse.

How we choose

We ask three questions: does any customer contract require data residency or physical isolation, what is the ratio between your largest and median tenant, and how often do you ship schema changes. Those three answers usually determine the model without further debate.

Tell us what you are building

Send a brief and a solution architect replies within one business day — with questions, not with a template.