Multi-Tenancy in Weaviate
Learn how to isolate data per tenant in a single Weaviate collection for scalable, secure multi-customer applications.
Multi-Tenancy in Weaviate is a free Vector Databases: Pinecone, Weaviate & pgvector lesson on CoddyKit — lesson 4 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Vector Databases: Pinecone, Weaviate & pgvector learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
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.
Frequently asked questions
Is the “Multi-Tenancy in Weaviate” lesson free?
Yes — the full text of “Multi-Tenancy in Weaviate” is free to read here on the web, and the Vector Databases: Pinecone, Weaviate & pgvector course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Vector Databases: Pinecone, Weaviate & pgvector course, upgrade to CoddyKit PRO.
What will I learn in “Multi-Tenancy in Weaviate”?
Learn how to isolate data per tenant in a single Weaviate collection for scalable, secure multi-customer applications. You practise Vector Databases: Pinecone, Weaviate & pgvector with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Vector Databases: Pinecone, Weaviate & pgvector?
No prior experience is required. Vector Databases: Pinecone, Weaviate & pgvector on CoddyKit is structured for beginners through advanced learners; this is — lesson 4 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Multi-Tenancy in Weaviate” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Vector Databases: Pinecone, Weaviate & pgvector lesson?
Yes. Every Vector Databases: Pinecone, Weaviate & pgvector lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Semantic Search & Hybrid Search
- Using Weaviate Modules
- Backup and Restore Strategies
- Multi-Tenancy in Weaviate