Designing a Multi-tenant System in Snowflake

Instruction: Describe how you would design a scalable and secure multi-tenant system using Snowflake.

Context: This question tests the candidate's understanding of multi-tenancy concepts and their ability to design a scalable and secure multi-tenant system in Snowflake.

Updated

Official answer

Choose the isolation boundary from tenant risk, residency, scale and operational needs. Separate accounts offer a stronger administrative boundary; separate databases/schemas simplify object-level separation; shared tables reduce object proliferation but require carefully enforced tenant access.

Namespaces alone are not authorization. Map authenticated tenant identity to approved roles and objects, review inherited/future grants, and avoid broad shared service identities where tenant isolation depends on caller-supplied SQL. Parameterize values and allowlist dynamic object selection.

For shared tables, include tenant_id in keys and relevant joins, and apply supported row access policies with a trusted entitlement mapping. Test policy behavior across roles, views and sharing. A row access policy controls visibility and does not by itself validate every inserted tenant_id, so enforce write authorization too.

With connection pooling, reset or isolate session role/context so one request cannot inherit another tenant's permissions. Application caches and exports also need tenant-scoped keys and access checks.

Separate heavy tenants or workloads onto suitable warehouses where necessary. Multi-cluster scaling handles concurrency within limits; it is not a guarantee that one tenant cannot consume another's capacity. Apply quotas/concurrency controls and monitor latency and cost per tenant.

Test cross-tenant reads/writes, guessed IDs, missing entitlements, role changes, pooled-session reuse and offboarding. Confirm that operational support and recovery paths preserve the same boundary.

Row access policies, warehouse concurrency, access control

Related Questions