0Pricing
Vector Databases: Pinecone, Weaviate & pgvector · Lekcja

Wielodostępność w Weaviate

Dowiedz się, jak izolować dane poszczególnych tenantów w jednej kolekcji Weaviate na potrzeby skalowalnych i bezpiecznych aplikacji obsługujących wielu klientów.

Wielodostępność w Weaviate to bezpłatna lekcja Vector Databases: Pinecone, Weaviate & pgvector na CoddyKit. To lekcja 4 z 4. Możesz przeczytać całą lekcję poniżej za darmo — a potem ćwiczyć ją interaktywnie w przeglądarce z wbudowanym edytorem kodu i tutorem AI dostępnym 24/7. To część ścieżki edukacyjnej Vector Databases: Pinecone, Weaviate & pgvector, a Twój postęp synchronizuje się między webem a aplikacją CoddyKit. Kurs Vector Databases: Pinecone, Weaviate & pgvector zawiera 4 lekcji w sumie.

Części tej lekcji nie zostały jeszcze przetłumaczone i są wyświetlane po angielsku.

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.

Często zadawane pytania

Czy lekcja „Wielodostępność w Weaviate” jest bezpłatna?

Tak — pełny tekst „Wielodostępność w Weaviate” jest dostępny za darmo tutaj w sieci. Aby ćwiczyć ją interaktywnie (wbudowany edytor kodu i tutor AI dostępny 24/7) i odblokować resztę kursu Vector Databases: Pinecone, Weaviate & pgvector, przejdź na CoddyKit PRO. Kurs Vector Databases: Pinecone, Weaviate & pgvector zawiera 4 lekcji w sumie.

Co nauczysz się w „Wielodostępność w Weaviate”?

Dowiedz się, jak izolować dane poszczególnych tenantów w jednej kolekcji Weaviate na potrzeby skalowalnych i bezpiecznych aplikacji obsługujących wielu klientów. Ćwiczysz Vector Databases: Pinecone, Weaviate & pgvector z praktycznym kodem, który uruchamiasz bezpośrednio w przeglądarce, a tutor AI dostępny 24/7 odpowiada na Twoje pytania podczas pracy nad lekcją.

Czy potrzebuję doświadczenia, aby zacząć Vector Databases: Pinecone, Weaviate & pgvector?

Nie wymagamy żadnego doświadczenia. Vector Databases: Pinecone, Weaviate & pgvector w CoddyKit jest strukturyzowany dla początkujących i zaawansowanych użytkowników, więc możesz zacząć tutaj lub od początku i uczyć się w swoim tempie. To lekcja 4 z 4.

Ile czasu zajmuje lekcja „Wielodostępność w Weaviate”?

Większość lekcji CoddyKit trwa około 5–10 minut. Każda lekcja to mały, interaktywny krok, dzięki czemu robisz systematyczne postępy i zawsze wracasz dokładnie do tego samego miejsca — na webie i w aplikacji.

Czy mogę pisać i uruchamiać kod w tej lekcji Vector Databases: Pinecone, Weaviate & pgvector?

Tak. Każda lekcja Vector Databases: Pinecone, Weaviate & pgvector zawiera wbudowany edytor kodu, więc piszesz i uruchamiasz prawdziwy kod bezpośrednio w przeglądarce i od razu otrzymujesz sprzężenie zwrotne od AI — bez konfiguracji na komputerze.

Wszystkie lekcje w tym kursie

  1. Wyszukiwanie semantyczne i hybrydowe
  2. Korzystanie z modułów Weaviate
  3. Strategie tworzenia kopii zapasowych i przywracania
  4. Wielodostępność w Weaviate
← Powrót do Vector Databases: Pinecone, Weaviate & pgvector