0Pricing
Vector Databases: Pinecone, Weaviate & pgvector · درس

تعدد المستأجرين في Weaviate

تعلّم كيفية عزل البيانات لكل مستأجر داخل مجموعة Weaviate واحدة لإنشاء تطبيقات قابلة للتوسع وآمنة ومتعددة العملاء.

تعدد المستأجرين في Weaviate درس مجاني في Vector Databases: Pinecone, Weaviate & pgvector على CoddyKit. هذا هو الدرس 4 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في Vector Databases: Pinecone, Weaviate & pgvector، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة Vector Databases: Pinecone, Weaviate & pgvector 4 دروس في المجموع.

بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.

Why Multi-Tenancy?

Multi-tenancy lets one Weaviate collection serve many isolated customers (tenants) while keeping their data physically and logically separated.

  • One schema, many tenants
  • Strong data isolation
  • Efficient resource use vs. one collection per customer

Enabling Multi-Tenancy

You enable multi-tenancy at collection creation time by setting multiTenancyConfig.enabled = true. Once enabled, every object must belong to a tenant.

{
  "class": "Article",
  "multiTenancyConfig": { "enabled": true }
}

Creating Tenants

Tenants are added to a collection explicitly. Each tenant has a unique name and an activity status.

  • HOT: active, queryable
  • COLD: offloaded, must be activated first
POST /v1/schema/Article/tenants
[
  { "name": "customer-a" },
  { "name": "customer-b" }
]

Inserting Tenant Data

When inserting objects you must specify which tenant owns the object. Data for one tenant is never visible to another.

{
  "class": "Article",
  "tenant": "customer-a",
  "properties": { "title": "Hello" }
}

Querying Per Tenant

Every query must include the tenant parameter. Weaviate scopes the search to that tenant's shard only, improving both isolation and performance.

{
  Get {
    Article (tenant: "customer-a", limit: 5) {
      title
    }
  }
}

Tenant Isolation Guarantees

Each tenant gets its own shard. This means:

  • No cross-tenant data leakage
  • Independent indexing per tenant
  • Per-tenant lifecycle management

Activity Status & Offloading

Inactive tenants can be set to COLD to free memory, or offloaded to cloud storage. Reactivate them on demand to query again.

PUT /v1/schema/Article/tenants
[
  { "name": "customer-b", "activityStatus": "COLD" }
]

Listing & Deleting Tenants

You can list all tenants of a collection or delete a tenant entirely. Deleting a tenant removes all its data permanently.

GET /v1/schema/Article/tenants
DELETE /v1/schema/Article/tenants
["customer-b"]

Scaling with Many Tenants

Weaviate supports thousands of tenants efficiently because inactive shards consume minimal resources. Use COLD status aggressively for rarely-used tenants.

Python Client Example

The Python client makes tenant operations explicit via a tenant-scoped handle.

import weaviate
client = weaviate.connect_to_local()
articles = client.collections.get('Article')
tenant_a = articles.with_tenant('customer-a')
tenant_a.data.insert({'title': 'Edge case'})
client.close()

Best Practices

Guidelines for multi-tenant Weaviate:

  • Use one tenant per customer, not per request
  • Set unused tenants to COLD
  • Always validate the tenant param server-side to prevent enumeration

Quick Check

Test your understanding of multi-tenancy.

Recap

You learned to enable multi-tenancy, create and manage tenants, insert and query tenant-scoped data, and use COLD status for scaling. Multi-tenancy is the key to building secure, multi-customer apps on a single Weaviate collection.

الأسئلة الشائعة

هل درس «تعدد المستأجرين في Weaviate» مجاني؟

نعم — نص درس «تعدد المستأجرين في Weaviate» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة Vector Databases: Pinecone, Weaviate & pgvector، انتقل إلى CoddyKit PRO. تتضمن دورة Vector Databases: Pinecone, Weaviate & pgvector 4 دروس في المجموع.

ماذا ستتعلم في «تعدد المستأجرين في Weaviate»؟

تعلّم كيفية عزل البيانات لكل مستأجر داخل مجموعة Weaviate واحدة لإنشاء تطبيقات قابلة للتوسع وآمنة ومتعددة العملاء. تتمرن على Vector Databases: Pinecone, Weaviate & pgvector مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.

هل أحتاج إلى خبرة سابقة لأبدأ Vector Databases: Pinecone, Weaviate & pgvector؟

لا تُشترط خبرة سابقة. Vector Databases: Pinecone, Weaviate & pgvector على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 4 من أصل 4.

كم من الوقت يستغرق درس «تعدد المستأجرين في Weaviate»؟

معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.

هل يمكنني كتابة وتشغيل أكواد في درس Vector Databases: Pinecone, Weaviate & pgvector هذا؟

نعم. كل درس في Vector Databases: Pinecone, Weaviate & pgvector يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.

جميع الدروس في هذه الدورة

  1. البحث الدلالي والبحث الهجين
  2. استخدام وحدات Weaviate
  3. استراتيجيات النسخ الاحتياطي والاستعادة
  4. تعدد المستأجرين في Weaviate
← العودة إلى Vector Databases: Pinecone, Weaviate & pgvector