Vector Databases: Pinecone, Weaviate & pgvector · レッスン

Weaviateのマルチテナンシー

単一のWeaviateコレクション内でテナントごとにデータを分離し、スケーラブルで安全なマルチ顧客アプリケーションを構築する方法を学びます。

レッスン 4/413 ステップ

「Weaviateのマルチテナンシー」はCoddyKit上の無料Vector Databases: Pinecone, Weaviate & pgvectorレッスンです。 これはレッスン4/4です。 下記で完全なレッスンを無料で読むことができます。その後、ブラウザ内の組み込みコードエディタと24時間対応のAIチューターでハンズオン演習できます。 これは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.

無料で開始

AI チューターと学ぶ Vector Databases: Pinecone, Weaviate & pgvector — 無料

ブラウザでリアルコードを書いて実行し、24/7 の AI チューターから瞬時にサポートを受け、ウェブまたはアプリで続きから学習できます。

コース
12
レッスン
48

よくある質問

「Weaviateのマルチテナンシー」レッスンは無料ですか?

はい。「Weaviateのマルチテナンシー」の完全なテキストはこのウェブで無料で読めます。インタラクティブに演習し(組み込みコードエディタと24時間対応のAIチューター)、Vector Databases: Pinecone, Weaviate & pgvectorコースの残りをアンロックするには、CoddyKit PROにアップグレードしてください。 Vector Databases: Pinecone, Weaviate & pgvectorコースには全4レッスンが含まれています。

「Weaviateのマルチテナンシー」で何を学びますか?

単一のWeaviateコレクション内でテナントごとにデータを分離し、スケーラブルで安全なマルチ顧客アプリケーションを構築する方法を学びます。 ブラウザで直接実行するハンズオンコードでVector Databases: Pinecone, Weaviate & pgvectorを演習し、24時間対応のAIチューターがレッスンを進める中での質問に答えます。

Vector Databases: Pinecone, Weaviate & pgvectorを始めるのに経験は必要ですか?

事前経験は必要ありません。CoddyKitのVector Databases: Pinecone, Weaviate & pgvectorは初級者から上級者向けに構成されているため、ここから始めるか最初から始めて、自分のペースで進むことができます。 これはレッスン4/4です。

「Weaviateのマルチテナンシー」レッスンにはどのくらい時間がかかりますか?

ほとんどのCoddyKitレッスンは約5~10分かかります。各レッスンはコンパクトでインタラクティブなので、着実に進歩し、ウェブとアプリ全体で正確に前回の場所から再開できます。

このVector Databases: Pinecone, Weaviate & pgvectorレッスンでコードを書いて実行できますか?

はい。すべてのVector Databases: Pinecone, Weaviate & pgvectorレッスンに組み込みコードエディタが含まれているため、ブラウザでリアルコードを書いて実行し、即座のAIフィードバックを取得できます。ローカル設定は不要です。

このコースのすべてのレッスン

  1. セマンティック検索とハイブリッド検索
  2. Weaviateモジュールの利用
  3. バックアップと復元の戦略
  4. Weaviateのマルチテナンシー
← Vector Databases: Pinecone, Weaviate & pgvectorに戻る