Guides
Multi-tenancy
In TopK, multi-tenancy is achieved through prefixing the tenant IDs in documents _id
value.
This design enables TopK to scale a single collection efficiently without performance degradation by leveraging smart sharding by document ID.
This approach still enables you to query across all tenants if needed.
Storing documents for a specific tenant
To store documents for a specific tenant, prepend the tenant ID to the document _id
value:
Querying documents for a specific tenant
To query documents for a specific tenant, use the tenant ID along with the startsWith()
filter: