Overview
In multi-tenant applications, data from different customers must be strictly isolated to prevent cross-tenant data leakage. Each tenant’s queries should only retrieve documents from their own data partition.Isolation strategies
Each vector database uses a different approach to tenant isolation:Configuration
Configure multi-tenancy for your chosen database:Usage example
Tenant management
List tenants
Delete tenant
Framework support
Multi-tenancy pipelines are available for both frameworks:Isolation guarantees
Milvus partition key isolation
Milvus partition key isolation
Mechanism: Partition key field with automatic routingGuarantees:
- Data physically separated into tenant-specific partitions
- Filter expressions automatically scoped to partition
- Zero cross-tenant data leakage
- Optimized for millions of tenants
Weaviate native multi-tenancy
Weaviate native multi-tenancy
Mechanism: Per-tenant shards with collection-level isolationGuarantees:
- Each tenant gets dedicated shard(s)
- Physical isolation at storage layer
- Independent tenant lifecycle management
- Enterprise-grade security boundaries
Pinecone namespace isolation
Pinecone namespace isolation
Mechanism: Namespace-based logical partitioningGuarantees:
- Logical isolation within shared index
- Query-time namespace filtering
- Supports 100,000+ namespaces per index
- Automatic scaling and management
Qdrant payload filtering
Qdrant payload filtering
Mechanism: Metadata-based filtering with index optimizationGuarantees:
- Tenant ID in payload metadata
- Automatic index creation for tenant field
- Tiered approach: small tenants share collection, large tenants promoted
- Efficient filtering with minimal overhead
Chroma tenant scoping
Chroma tenant scoping
Mechanism: Collection-per-tenant or database-per-tenantGuarantees:
- Complete physical isolation
- Independent collection management
- Flexible deployment strategies
- Simple access control
Security best practices
1
Validate tenant IDs
Always validate and sanitize tenant IDs before passing to pipelines. Prevent injection attacks by using allow-lists or UUID validation.
2
Enforce at application layer
Never rely solely on database isolation. Validate tenant access at the application layer before executing queries.
3
Audit tenant operations
Log all tenant-scoped operations for security auditing and compliance.
4
Test isolation boundaries
Write integration tests that verify cross-tenant data leakage prevention.
Performance at scale
Benchmarks by tenant count
Cost optimization
Resource sharing strategies
Migration between strategies
Migrate from shared to dedicated isolation as tenants grow:Related features
Namespaces
Logical data partitioning
Metadata filtering
Structured constraints
Cost-optimized RAG
Efficient production pipelines
Agentic RAG
Multi-step retrieval loops