Overview
Namespaces provide isolated logical partitions within a vector database. Each namespace contains its own subset of vectors and can be queried independently or in combination with other namespaces.Namespaces are ideal when you need data isolation but want to avoid the overhead of managing separate collections or indexes.
Use cases
Environment separation
Separate dev, staging, and production data in the same index
Dataset versioning
Maintain multiple versions of embeddings or content
Content organization
Partition by document type, source, or category
A/B testing
Compare retrieval quality across different embedding models
Database strategies
Each vector database implements namespaces differently:| Database | Isolation Strategy | Implementation |
|---|---|---|
| Pinecone | Native namespace support | Index-level namespaces with automatic routing |
| Milvus | Partition-based isolation | Partition key field with filter expressions |
| Weaviate | Tenant mechanism | Native multi-tenancy with per-tenant shards |
| Qdrant | Collection-based | Separate collections with shared configuration |
| Chroma | Collection-based | Individual collections per namespace |
Configuration
Namespace configuration varies by database:Usage example
Management operations
Get namespace statistics
Delete namespace
Cross-namespace search
Query multiple namespaces simultaneously with performance comparison:Namespace isolation pipeline
Use dedicated search and indexing pipelines for namespace-scoped operations:Performance considerations
Pinecone namespaces
Pinecone namespaces
Pinecone provides native namespace support with minimal overhead. Namespaces share the same index resources and scale automatically. Best for 100,000+ namespaces.
Milvus partitions
Milvus partitions
Milvus uses partition keys for isolation, supporting millions of tenants. Partition-based queries are optimized and only scan relevant data. Enable partition key field during collection creation.
Weaviate tenants
Weaviate tenants
Weaviate’s tenant mechanism provides strong isolation with per-tenant shards. Enterprise-grade performance with automatic tenant management. Ideal for strict data separation requirements.
Collection-based (Qdrant, Chroma)
Collection-based (Qdrant, Chroma)
Collection-based strategies create separate collections per namespace. More overhead but strongest isolation. Best for under 1000 namespaces.
Best practices
Choose the right strategy
Use Pinecone or Milvus for high namespace counts (10,000+), collection-based approaches for strong isolation needs.
Consistent naming
Use clear namespace naming conventions:
{environment}_{version} or {team}_{dataset}.Related features
Multi-tenancy
Tenant-isolated indexing and retrieval
Metadata filtering
Structured constraints on retrieval
Hybrid search
Dense and sparse retrieval
Cost-optimized RAG
Efficient production pipelines