Skip to main content
Multi-tenancy allows you to serve multiple customers (tenants) from a single Qdrant collection while maintaining data isolation and performance. Qdrant provides several strategies to implement multi-tenancy efficiently.

Architecture Approaches

Collection per Tenant

Isolation: MaximumComplexity: HighBest for: Less than 10 tenants

Payload Filtering

Isolation: LogicalComplexity: LowBest for: 100s-1000s tenants

Shard Keys

Isolation: PhysicalComplexity: MediumBest for: 10s-100s tenants

Payload Filtering Approach

The most common and scalable approach: store all tenants in one collection with a tenant identifier in the payload.

Collection Setup

Creating Tenant Index

Mark the tenant field with is_tenant: true for optimization:
The is_tenant flag tells Qdrant to optimize the index structure for frequent tenant-specific filtering.

Inserting Tenant Data

Searching with Tenant Filter

Always filter by tenant in your searches:

Python Example

Tenant Index Optimization

What is_tenant Does

When you mark a field with is_tenant: true:
  1. HNSW graph optimization: Qdrant builds more aggressive HNSW links within tenant boundaries
  2. Payload index structure: Optimized for tenant-specific lookups
  3. Query planning: Tenant filters are pushed down early in query execution

Index Types Supporting is_tenant

Best for string tenant IDs.

Shard Key Partitioning

For physical isolation of tenant data within a collection, use shard keys.

Creating Sharded Collection

Creating Tenant Shards

Create dedicated shards for specific tenants:

Inserting to Specific Shard

Searching Specific Shard

Using shard keys automatically routes operations to the correct physical shard, avoiding unnecessary cross-shard operations.

Tenant Migration

Move a tenant to its own dedicated shard:

Performance Considerations

Query Performance

Create payload indexes on tenant identifiers. Without indexes, filtering requires scanning all points.
Mark tenant fields with is_tenant: true to enable HNSW graph optimizations:
This builds better connections within tenant boundaries.
If you ALWAYS filter by tenant, disable global HNSW:
This saves memory and forces optimized tenant-specific search.

Memory Management

Per-tenant data distribution:
  • Monitor tenant sizes to prevent skew
  • Consider separate collections for extremely large tenants
  • Use quantization to reduce per-point memory usage
HNSW graph memory:
  • Disabled global HNSW (m=0): Only stores tenant-specific graphs
  • Enabled global HNSW: Stores full graph across all tenants

Scaling Guidelines

Strategy: Payload filteringConfiguration:
  • Single collection
  • Tenant index with is_tenant: true
  • Global HNSW enabled
Characteristics:
  • Simple management
  • Efficient resource usage
  • Good performance

Isolation and Security

Data Isolation

Payload filtering provides logical isolation only:
Payload filtering does NOT provide cryptographic isolation. All tenant data exists in the same physical storage. For regulatory compliance requiring physical separation, use separate collections or shard keys.

Access Control

Implement tenant isolation at the application layer:

Best Practices

1

Design Tenant ID Strategy

Choose stable, immutable tenant identifiers:
  • UUIDs for maximum flexibility
  • Integer IDs for compact storage
  • String keys for human readability
2

Create Proper Indexes

Always index tenant fields before loading data:
3

Monitor Tenant Distribution

Track per-tenant sizes and query patterns:
  • Large tenants may need dedicated shards
  • Inactive tenants can be archived
  • Hot tenants may need special handling
4

Test Isolation

Verify filters work correctly:

Common Patterns

Hierarchical Tenancy

Organization → Team → User hierarchy:
Filter at appropriate level:

Multi-Tenant with Regional Data

Combine tenant and region filtering:
Use compound filters:

Monitoring and Observability

Track these metrics per tenant:
  • Point count: Number of vectors per tenant
  • Query latency: P50, P95, P99 search times
  • Query volume: Requests per tenant per time period
  • Storage usage: Disk/memory consumption per tenant
  • Indexing lag: Time to index new tenant data