Skip to content

Commit 515ad81

Browse files
committed
comments after James' review
1 parent 37184bc commit 515ad81

File tree

3 files changed

+27
-7
lines changed

3 files changed

+27
-7
lines changed

articles/cosmos-db/TOC.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
href: gen-ai/knn-vs-ann.md
4141
- name: Multi-tenancy for vector search
4242
href: nosql/multi-tenancy-vector-search.md
43-
- name: Generative AI
43+
- name: AI Applications
4444
expanded: true
4545
items:
4646
- name: Quickstart - build a RAG chatbot

articles/cosmos-db/gen-ai/quickstart-rag-chatbot.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,26 @@ Install the necessary Python packages to interact with Azure Cosmos DB and other
4848

4949
Populate `sample_env_file.env` with the appropriate credentials for Azure Cosmos DB and Azure OpenAI.
5050

51+
```env
52+
cosmos_uri = "https://<replace with cosmos db account name>.documents.azure.com:443/"
53+
cosmos_key = "<replace with cosmos db account key>"
54+
cosmos_database_name = "database"
55+
cosmos_collection_name = "vectorstore"
56+
cosmos_vector_property_name = "vector"
57+
cosmos_cache_database_name = "database"
58+
cosmos_cache_collection_name = "vectorcache"
59+
openai_endpoint = "<replace with azure openai endpoint>"
60+
openai_key = "<replace with azure openai key>"
61+
openai_type = "azure"
62+
openai_api_version = "2023-05-15"
63+
openai_embeddings_deployment = "<replace with azure openai embeddings deployment name>"
64+
openai_embeddings_model = "<replace with azure openai embeddings model - e.g. text-embedding-3-large"
65+
openai_embeddings_dimensions = "1536"
66+
openai_completions_deployment = "<replace with azure openai completions deployment name>"
67+
openai_completions_model = "<replace with azure openai completions model - e.g. gpt-35-turbo>"
68+
storage_file_url = "https://cosmosdbcosmicworks.blob.core.windows.net/fabcondata/movielens_dataset.json"
69+
```
70+
5171
```python
5272
# Import the required libraries
5373
import time

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ ms.author: thvankra
1616
> "OpenAI relies on Cosmos DB to dynamically scale their ChatGPT service – one of the fastest-growing consumer apps ever – enabling high reliability and low maintenance."
1717
> — Satya Nadella
1818
19-
Azure Cosmos DB stands out as the world's first serverless vector search database, offering unparalleled scalability and performance. By using Azure Cosmos DB, users can enhance their vector search capabilities, ensuring high reliability and low maintenance for multitenant applications.
19+
Azure Cosmos DB stands out as the world's first full-featured serverless operational database with vector search, offering unparalleled scalability and performance. By using Azure Cosmos DB, users can enhance their vector search capabilities, ensuring high reliability and low maintenance for multitenant applications.
2020

21-
Multi-tenancy enables a single instance of a database to serve multiple customers, or tenants, simultaneously. This approach efficiently shares infrastructure and operational overhead, resulting in cost savings and simplified management. It's a crucial design consideration for SaaS applications and some internal enterprise solutions.
21+
Multitenancy enables a single instance of a database to serve multiple customers, or tenants, simultaneously. This approach efficiently shares infrastructure and operational overhead, resulting in cost savings and simplified management. It's a crucial design consideration for SaaS applications and some internal enterprise solutions.
2222

23-
Multi-tenancy introduces complexity. Your system must scale efficiently to maintain high performance across all tenants, who may have unique workloads, requirements, and service-level agreements (SLAs).
23+
Multitenancy introduces complexity. Your system must scale efficiently to maintain high performance across all tenants, who may have unique workloads, requirements, and service-level agreements (SLAs).
2424

2525
Imagine a fictional AI-assisted research platform called ResearchHub. Serving thousands of companies and individual researchers, ResearchHub manages varying user bases, data scales, and SLAs. Ensuring low query latency and high performance is vital for sustaining an excellent user experience.
2626

@@ -32,7 +32,7 @@ In Azure Cosmos DB, we recommend two primary approaches to managing multi-tenanc
3232

3333
### 1. Partition key-per-tenant
3434

35-
For a higher density of tenants and lower isolation, the partition key-per-tenant model is effective. Each tenant is assigned a unique partition key within a given container, allowing logical separation of data. This strategy works best when each tenant has roughly the same workload volume. If there is significant skew, customers should consider isolating those tenants in their own account. Additionally, if a single tenant has more than 20GB of data, [hierarchical partition keys (HPK)](#hierarchical-partitioning-enhanced-data-organization) should be used.
35+
For a higher density of tenants and lower isolation, the partition key-per-tenant model is effective. Each tenant is assigned a unique partition key within a given container, allowing logical separation of data. This strategy works best when each tenant has roughly the same workload volume. If there is significant skew, customers should consider isolating those tenants in their own account. Additionally, if a single tenant has more than 20GB of data, [hierarchical partition keys (HPK)](#hierarchical-partitioning-enhanced-data-organization) should be used. For vector search in particular, quantizedFlat index may perform very well if vector search queries can be focused to a particular partition or sets of partitions.
3636

3737
**Benefits:**
3838
- **Cost Efficiency:** Sharing a single Cosmos DB account across multiple tenants reduces overhead.
@@ -42,7 +42,7 @@ For a higher density of tenants and lower isolation, the partition key-per-tenan
4242

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

4848
### Hierarchical partitioning: enhanced data organization
@@ -193,7 +193,7 @@ Azure Cosmos DB provides the tools necessary to build a robust, secure, and scal
193193

194194
[30-day Free Trial without Azure subscription](https://azure.microsoft.com/try/cosmosdb/)
195195

196-
[90-day Free Trial and up to $6,000 in throughput credits with Azure AI Advantage](../ai-advantage.md)
196+
[Multitenancy and Azure Cosmos DB](https://aka.ms/CosmosMultitenancy)
197197

198198
> [!div class="nextstepaction"]
199199
> [Use the Azure Cosmos DB lifetime free tier](../free-tier.md)

0 commit comments

Comments
 (0)