Multi-Tenant Analytics
Multi-tenant analytics is an architecture that serves multiple customers – each with their own data, users, and permissions – from a single analytics platform. Every SaaS product that embeds analytics faces this design problem, and every other technical decision flows from how it gets solved.
The core challenge: Customer A must never see Customer B's data. That sounds simple until you account for performance isolation, per-tenant customization, and the operational cost of managing hundreds or thousands of tenants on one platform.
Three isolation strategies
There are three primary approaches to tenant isolation, each with distinct tradeoffs.
Row-level filtering on a shared database. All tenants share the same tables. A tenant identifier column on every row controls visibility – queries are automatically filtered so each tenant sees only their data. This is the cheapest option to operate. One database, one schema, one set of tables. The tradeoff is weak isolation. A misconfigured filter or a missing WHERE clause exposes data across tenants. Performance isolation is also limited – a heavy query from one tenant can degrade response times for all others. Row-level security is the enforcement mechanism here, and it must be airtight.
Schema-per-tenant. Each tenant gets their own schema within a shared database. Tables are structurally identical but physically separate. This provides stronger isolation than row filtering – a query scoped to one schema cannot accidentally reach another. Operational complexity sits in the middle range: you manage one database but run migrations across every schema. Works well for tens to low hundreds of tenants. Beyond that, schema management becomes a burden.
Database-per-tenant. Each tenant gets their own database instance. Maximum isolation – a compromised connection string for one tenant reveals nothing about another. Performance isolation is also strongest, since each tenant has dedicated compute. The cost is highest here: provisioning, patching, backup, and connection management all multiply by tenant count. This strategy fits when data sensitivity is high (healthcare, financial services) or when tenants demand guaranteed performance SLAs. Dynamic database routing handles the connection logic, pointing each request to the correct database at query time.
Choosing the right strategy
The decision depends on two variables: data sensitivity and tenant count.
Low sensitivity, high tenant count – use row-level filtering. A B2B SaaS product with 5,000 small business customers sharing non-regulated data can operate efficiently on shared tables with strong row-level security.
Moderate sensitivity, moderate tenant count – use schema-per-tenant. An analytics product serving 50–200 mid-market customers with contractual data isolation requirements benefits from the physical separation without the operational overhead of individual databases.
High sensitivity or strict compliance requirements – use database-per-tenant. When tenants are enterprise customers in regulated industries, the operational cost is justified by the isolation guarantee.
Key requirements beyond isolation
Performance isolation. Even with row-level filtering, one tenant's dashboard load must avoid slowing down another's. This requires query queuing, concurrency limits, or dedicated compute per tenant class.
Tenant-specific customization. Different tenants need different default filters, different visible metrics, sometimes different data models entirely. The multi-tenancy layer must support per-tenant configuration without forking the codebase.
Scalable onboarding. Adding a new tenant should take minutes rather than engineering tickets. The chosen isolation strategy determines whether onboarding means inserting a row in a config table or provisioning infrastructure.
Why this decision is foundational
Multi-tenancy determines how you implement security, how you scale infrastructure, how you handle performance, and how you price your product. A row-level filtering approach that works at 100 tenants may collapse at 10,000. A database-per-tenant approach that guarantees isolation may be economically unviable for a self-serve product tier.
Get this decision right early. Migrating between isolation strategies mid-growth is one of the most expensive re-architecture efforts a SaaS engineering team can face.
The Holistics Perspective
Holistics supports three multi-tenancy strategies: row-level permissions (shared database, filtered by tenant), dynamic schema routing (shared database, separate schemas), and dynamic database routing (separate databases per tenant). The choice depends on the SaaS product's data architecture and isolation requirements.
See how Holistics approaches this →