Skip to content

Commit fd93efa

Browse files
committed
comments after feedback
1 parent 38dddbe commit fd93efa

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

articles/cosmos-db/nosql/multi-tenancy-vector-search.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
2+
23
title: Multi-tenancy in Azure Cosmos DB
34
description: Learn concepts for building multitenant gen-ai apps in Azure Cosmos DB
45
author: TheovanKraay
@@ -7,6 +8,7 @@ ms.subservice: nosql
78
ms.topic: conceptual
89
ms.date: 06/26/2024
910
ms.author: thvankra
11+
1012
---
1113

1214
# Multi-tenancy for vector search in Azure Cosmos DB
@@ -36,10 +38,12 @@ For a higher density of tenants and lower isolation, the partition key-per-tenan
3638
- **Cost Efficiency:** Sharing a single Cosmos DB account across multiple tenants reduces overhead.
3739
- **Scalability:** Can manage a large number of tenants, each isolated within their partition key.
3840
- **Simplified Management:** Fewer Cosmos DB accounts to manage.
41+
- **Hierarchical Partition Keys (HPK):** Optimizes data organization and query performance in multi-tenant apps with a high number of tenants.
3942

4043
**Drawbacks:**
4144
- **Resource Contention:** Shared resources can lead to contention during peak usage.
4245
- **Limited Isolation:** Logical but not physical isolation, which may not meet stringent security needs.
46+
- **Less Flexibility:** Reduced flexibility per tenant for enabling account-level features like geo-replication, point-in-time restore (PITR), and customer-managed keys (CMK).
4347

4448
### Hierarchical partitioning: enhanced data organization
4549

@@ -48,14 +52,16 @@ For a higher density of tenants and lower isolation, the partition key-per-tenan
4852
**Advantages:**
4953
- **Optimized Queries:** More precise targeting of subpartitions at the parent partition level reduces query latency.
5054
- **Improved Scalability:** Facilitates deeper data segmentation for easier scaling.
51-
- **Better Resource Allocation:** Evenly distributes workloads, minimizing bottlenecks.
55+
- **Better Resource Allocation:** Evenly distributes workloads, minimizing bottlenecks for high tenant counts.
56+
57+
**Considerations:**
58+
- If tenants have very few HPK, this can lead to bottlenecks since all documents with the same first-level key will write to the same physical partition(s).
5259

5360
**Example:**
5461
ResearchHub can stratify data within each tenant’s partition by organizing it at departmental levels, facilitating efficient management and queries.
5562

5663
![ResearchHub AI Data Stratification](../media/gen-ai/multi-tenant/hpk.png)
5764

58-
5965
### 2. Account-per-tenant
6066

6167
For maximum isolation, the account-per-tenant model is preferable. Each tenant gets a dedicated Cosmos DB account, ensuring complete separation of resources.
@@ -64,6 +70,7 @@ For maximum isolation, the account-per-tenant model is preferable. Each tenant g
6470
- **High Isolation:** No contention or interference due to dedicated resources.
6571
- **Custom SLAs:** Resources and SLAs can be tailored to individual tenant needs.
6672
- **Enhanced Security:** Physical data isolation ensures robust security.
73+
- **Flexibility:** Tenants can enable account-level features like geo-replication, point-in-time restore (PITR), and customer-managed keys (CMK) as needed.
6774

6875
**Drawbacks:**
6976
- **Increased Management:** Higher complexity in managing multiple Cosmos DB accounts.
@@ -157,7 +164,7 @@ Azure Cosmos DB's support for DiskANN vector index capability makes it an excell
157164
- **Hierarchical Partitioning:** Implement hierarchical partitioning to further segment data within each tenant’s partition, improving query performance and resource distribution.
158165

159166
**3. Security and Compliance:**
160-
- **Customer Managed Keys:** Implement customer-managed keys for data encryption at rest, ensuring each tenant’s data is securely isolated.
167+
- **Customer-Managed Keys:** Implement customer-managed keys for data encryption at rest, ensuring each tenant’s data is securely isolated.
161168
- **Regular Key Rotation:** Enhance security by regularly rotating encryption keys stored in Azure Key Vault.
162169

163170
### Real-world example: implementing ResearchHub

0 commit comments

Comments
 (0)