Options: one collection or index per tenant (strong isolation and easy deletion, but overhead grows with tenant count), a namespace or partition per tenant (a common balance), or a shared collection with a tenant ID filter (efficient for many small tenants but needs fast, well-tested filtering).
Consider isolation guarantees, per-tenant deletion and export (privacy requests), noisy-neighbor limits (quotas, rate limits), backups, and the cost of many small indexes.
Always enforce the tenant filter in the database query, never after retrieval, and test cross-tenant leakage.
Loading…