Architecture · 12 min

Data boundaries in multi-tenant SaaS: a practical architecture guide

Data boundaries in multi-tenant SaaS: a practical architecture guide

Single DB, separate schema, separate cluster — which boundary fits which scenario? We compare three approaches we've shipped.

Three main models

There are three baseline approaches: single DB with a tenant column, shared DB with per-tenant schemas, and one isolated DB per tenant. Each fits a different envelope — one might be right for 100 tenants, another only for 5 large enterprise clients.

Operational cost

Schema-per-tenant repeats migrations per tenant; once you cross 200 tenants, pgbouncer and max_connections turn into a real problem. You'll see this in your production pipeline before you see it in the architecture diagram.

From the field

For ViraCup we run shared-DB + tenant column to support 12K+ athletes. For DOKA, audit isolation required separate schemas. Both are right — because the requirement is different.

Decision frame

Answer three questions: 1) What does the regulator demand? 2) What is per-tenant load shape? 3) Is backup/restore per-tenant or global? The answers leave you with one choice.

Share
LinkedIn·X·
More

Other posts