You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/cosmos-db/nosql/multi-tenancy-vector-search.md
+10-3Lines changed: 10 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,5 @@
1
1
---
2
+
2
3
title: Multi-tenancy in Azure Cosmos DB
3
4
description: Learn concepts for building multitenant gen-ai apps in Azure Cosmos DB
4
5
author: TheovanKraay
@@ -7,6 +8,7 @@ ms.subservice: nosql
7
8
ms.topic: conceptual
8
9
ms.date: 06/26/2024
9
10
ms.author: thvankra
11
+
10
12
---
11
13
12
14
# 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
36
38
-**Cost Efficiency:** Sharing a single Cosmos DB account across multiple tenants reduces overhead.
37
39
-**Scalability:** Can manage a large number of tenants, each isolated within their partition key.
38
40
-**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.
39
42
40
43
**Drawbacks:**
41
44
-**Resource Contention:** Shared resources can lead to contention during peak usage.
42
45
-**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).
43
47
44
48
### Hierarchical partitioning: enhanced data organization
45
49
@@ -48,14 +52,16 @@ For a higher density of tenants and lower isolation, the partition key-per-tenan
48
52
**Advantages:**
49
53
-**Optimized Queries:** More precise targeting of subpartitions at the parent partition level reduces query latency.
50
54
-**Improved Scalability:** Facilitates deeper data segmentation for easier scaling.
-**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).
52
59
53
60
**Example:**
54
61
ResearchHub can stratify data within each tenant’s partition by organizing it at departmental levels, facilitating efficient management and queries.
55
62
56
63

57
64
58
-
59
65
### 2. Account-per-tenant
60
66
61
67
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
64
70
-**High Isolation:** No contention or interference due to dedicated resources.
65
71
-**Custom SLAs:** Resources and SLAs can be tailored to individual tenant needs.
66
72
-**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.
67
74
68
75
**Drawbacks:**
69
76
-**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
157
164
-**Hierarchical Partitioning:** Implement hierarchical partitioning to further segment data within each tenant’s partition, improving query performance and resource distribution.
158
165
159
166
**3. Security and Compliance:**
160
-
-**CustomerManaged 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.
161
168
-**Regular Key Rotation:** Enhance security by regularly rotating encryption keys stored in Azure Key Vault.
0 commit comments