Skip to main content
Multi-tenancy isolates customer data so each tenant only sees their own documents. VectorDB provides database-specific isolation strategies including namespaces, partitions, payload filters, and tenant-scoped collections.

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.
Improper tenant isolation can lead to serious data leakage issues. VectorDB ensures isolation through database-native mechanisms.

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

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
Best for: Applications with 10,000+ tenants requiring strict isolation
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
Best for: SaaS applications with strict compliance requirements
Mechanism: Namespace-based logical partitioningGuarantees:
  • Logical isolation within shared index
  • Query-time namespace filtering
  • Supports 100,000+ namespaces per index
  • Automatic scaling and management
Best for: Multi-tenant SaaS with managed infrastructure preference
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
Best for: Flexible multi-tenant architectures with mixed tenant sizes
Mechanism: Collection-per-tenant or database-per-tenantGuarantees:
  • Complete physical isolation
  • Independent collection management
  • Flexible deployment strategies
  • Simple access control
Best for: Development, prototyping, small-scale deployments

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

Choose Milvus or Pinecone for applications expecting 10,000+ tenants. Use Weaviate for enterprise compliance needs. Qdrant and Chroma work well for smaller deployments.

Cost optimization

Resource sharing strategies

Migration between strategies

Migrate from shared to dedicated isolation as tenants grow:

Namespaces

Logical data partitioning

Metadata filtering

Structured constraints

Cost-optimized RAG

Efficient production pipelines

Agentic RAG

Multi-step retrieval loops