Vector Databases Compared: Pinecone vs Weaviate vs Qdrant vs Milvus
Vector databases are the backbone of modern AI applications — powering semantic search, recommendation systems, RAG pipelines, and multi-modal AI. This guide compares the leading options with real performance data and production code.
Why Vector Databases Matter
Traditional databases are designed for exact matches. Vector databases are designed for similarity search — finding items that are conceptually similar, not just lexically identical.
A B-tree lookup returns rows that match a key exactly; a vector index returns the nearest neighbours under a distance metric, which is a different problem with different costs. Exact nearest neighbour over 100M rows at 768 float32 dimensions is about 307 GB of data and, at 2.0 TB/s of memory bandwidth, roughly 154 ms per query — acceptable once, unacceptable at 1,000 queries per second. Every product in this comparison therefore stores the vectors in a form that trades a little recall for a large reduction in work: a graph such as HNSW visits a few hundred candidates instead of 100M, which is where the 0.95+ recall at logarithmic cost comes from.
The practical consequence is that you must measure recall against exact search on a sample rather than trusting published numbers. Index parameters interact with corpus size, dimension, and metric, so a configuration that holds 0.97 recall at 1M vectors may sit at 0.88 at 100M.
# Traditional search: exact match
SELECT * FROM products WHERE name = 'wireless headphones'
# Vector search: semantic similarity
# "noise canceling earbuds" matches "wireless headphones"
results = vector_db.search(
query_embedding=embed("noise canceling earbuds"),
top_k=5
)
Database Comparison
The four products split along two axes: who operates the cluster, and how much control you keep over the index. Managed means the vendor owns upgrades, backups, and shard rebalancing, which removes an entire class of on-call work and removes your ability to tune placement, disk layout, and query planner behaviour. Self-hosted means the opposite. A second axis is filtering: metadata filters applied during the search can collapse recall when they are too narrow, because a request for the top 5 within one category after a global graph traversal may return fewer than 5 candidates unless the index over-fetches. Ask each candidate how it executes a filtered search before benchmarking anything else.
Overview
| Feature | Pinecone | Weaviate | Qdrant | Milvus |
|---|---|---|---|---|
| Type | Managed | Open source | Open source | Open source |
| Deployment | Cloud only | Self-host/Cloud | Self-host/Cloud | Self-host/Cloud |
| Max vectors | 10B+ | 1B+ | 10B+ | 10B+ |
| Latency (p99) | <50ms | <100ms | <50ms | <100ms |
| Price |
| $ | $$ | | Best for | Easy start | Multi-modal | Performance | Enterprise |
Pinecone
Fully managed, zero-ops vector database.
import pinecone
# Initialize
pc = pinecone.Pinecone(api_key="YOUR_API_KEY")
index = pc.Index("products")
# Upsert vectors
index.upsert(vectors=[
{
"id": "product_1",
"values": embedding_model.encode("Wireless Bluetooth Headphones"),
"metadata": {
"category": "electronics",
"price": 79.99,
"brand": "AudioTech"
}
}
])
# Search
results = index.query(
vector=embedding_model.encode("noise canceling earbuds"),
top_k=5,
include_metadata=True,
filter={"category": {"$eq": "electronics"}}
)
# Hybrid search (combines vector + keyword)
results = index.query(
vector=embedding_model.encode("headphones"),
top_k=5,
include_metadata=True,
sparse_vector={
"indices": [1, 5, 10],
"values": [0.5, 0.3, 0.2] # BM25 scores
}
)
Pros:
- Zero operations overhead
- Excellent performance
- Built-in hybrid search
- Easy scaling
Cons:
- Vendor lock-in
- Expensive at scale
- Limited customization
Weaviate
Open source with rich multi-modal capabilities.
import weaviate
# Connect
client = weaviate.connect_to_local()
# Define schema
collection = client.collections.create(
name="Product",
vectorizer_config=weaviate.classes.config.Configure.Vectorizer.text2vec_openai(),
properties=[
weaviate.classes.config.Property(
name="name",
data_type=weaviate.classes.config.DataType.TEXT
),
weaviate.classes.config.Property(
name="price",
data_type=weaviate.classes.config.DataType.NUMBER
),
]
)
# Auto-vectorize on insert
product = collection.data.insert(
properties={
"name": "Wireless Bluetooth Headphones",
"price": 79.99
}
)
# Vector search
results = collection.query.near_text(
query="noise canceling earbuds",
limit=5,
return_metadata=weaviate.classes.config.QueryMetadata(distance=True)
)
# Multi-modal search (text + image)
results = collection.query.near_image(
image=open("headphones.jpg", "rb").read(),
limit=5
)
# Hybrid search
results = collection.query.hybrid(
query="wireless headphones",
alpha=0.75, # 0=pure vector, 1=pure keyword
limit=5
)
Pros:
- Rich multi-modal support
- Built-in vectorization
- GraphQL API
- Active community
Cons:
- More complex setup
- Higher memory usage
- Slower than Qdrant at scale
Qdrant
High-performance, Rust-based vector database.
from qdrant_client import QdrantClient
from qdrant_client.models import (
Distance, VectorParams, PointStruct,
Filter, FieldCondition, MatchValue
)
# Connect
client = QdrantClient("localhost", port=6333)
# Create collection
client.create_collection(
collection_name="products",
vectors_config=VectorParams(
size=1536,
distance=Distance.COSINE
)
)
# Insert points
client.upsert(
collection_name="products",
points=[
PointStruct(
id=1,
vector=embedding_model.encode("Wireless Bluetooth Headphones"),
payload={
"name": "Wireless Bluetooth Headphones",
"category": "electronics",
"price": 79.99
}
)
]
)
# Search with filters
results = client.search(
collection_name="products",
query_vector=embedding_model.encode("noise canceling earbuds"),
query_filter=Filter(
must=[
FieldCondition(
key="category",
match=MatchValue(value="electronics")
)
]
),
limit=5
)
# Geo search
results = client.search(
collection_name="stores",
query_vector=embedding_model.encode("coffee shop"),
query_filter=Filter(
must=[
FieldCondition(
key="location",
geo_radius=GeoRadius(
center=GeoPoint(lon=-73.9857, lat=40.7484),
radius=1000 # meters
)
)
]
),
limit=5
)
Pros:
- Best performance (Rust)
- Rich filtering
- Payload support
- Cost-effective
Cons:
- Smaller community
- Fewer integrations
- No built-in vectorizer
Milvus
Enterprise-grade, distributed vector database.
from pymilvus import (
connections, Collection, FieldSchema,
CollectionSchema, DataType
)
# Connect
connections.connect("default", host="localhost", port="19530")
# Define schema
fields = [
FieldSchema(name="id", dtype=DataType.INT64, is_primary=True),
FieldSchema(name="embedding", dtype=DataType.FLOAT_VECTOR, dim=1536),
FieldSchema(name="text", dtype=DataType.VARCHAR, max_length=1000),
FieldSchema(name="category", dtype=DataType.VARCHAR, max_length=100),
]
schema = CollectionSchema(fields)
collection = Collection("products", schema)
# Create index
collection.create_index(
field_name="embedding",
index_params={
"metric_type": "COSINE",
"index_type": "HNSW",
"params": {"M": 16, "efConstruction": 256}
}
)
# Insert data
collection.insert([
[1, 2, 3], # ids
[emb1, emb2, emb3], # embeddings
["text1", "text2", "text3"], # texts
["cat1", "cat2", "cat3"], # categories
])
# Search
results = collection.search(
data=[query_embedding],
anns_field="embedding",
param={"metric_type": "COSINE", "params": {"ef": 128}},
limit=5,
output_fields=["text", "category"]
)
Pros:
- Distributed architecture
- Massive scale
- Rich index types
- Enterprise features
Cons:
- Complex setup
- Higher resource usage
- Steeper learning curve
Performance Benchmarks
Treat these numbers as an order-of-magnitude guide, not as a prediction for your cluster. Latency depends on dimension, metric, filter selectivity, and whether the working set fits in memory: the same Qdrant node that answers in 5 ms over 1M vectors in RAM can cross 40 ms once the graph spills to disk. Read p99 rather than p50, because the tail is what users feel and what autoscalers react to. Throughput figures assume a warm index and a steady request rate; a cold start after a restart re-reads the graph and can double p99 for the first several minutes.
Search Latency (1M vectors, 1536 dimensions)
| Database | p50 | p95 | p99 |
| Database | p50 | p95 | p99 |
|---|---|---|---|
| Pinecone | 8ms | 25ms | 45ms |
| Weaviate | 12ms | 45ms | 85ms |
| Qdrant | 5ms | 18ms | 35ms |
| Milvus | 10ms | 35ms | 65ms |
Throughput (queries per second)
| Database | Single node | Clustered |
|---|---|---|
| Pinecone | 1,000 | 10,000+ |
| Weaviate | 500 | 5,000+ |
| Qdrant | 2,000 | 20,000+ |
| Milvus | 800 | 15,000+ |
Pricing (1M vectors, 1536 dimensions)
| Database | Monthly Cost |
|---|---|
| Pinecone (Standard) | $70 |
| Pinecone (Enterprise) | $200+ |
| Weaviate Cloud | $25-50 |
| Qdrant Cloud | $25-50 |
| Milvus (self-hosted) | Infrastructure only |
When to Use Each
Decision order matters more than the list itself. Start with the constraints that eliminate options: a hard requirement for on-prem data removes Pinecone immediately, and a requirement for a billion filtered vectors with sub-50 ms p99 removes most single-node deployments. Then weigh cost at your actual scale — at 1M vectors the monthly difference between the managed options is under fifty dollars, while at 500M it is several thousand, so an early choice made on price is usually made on the wrong number. Finally, weigh lock-in: a portable client abstraction costs you little and keeps migration a configuration change instead of a rewrite, but it will not hide differences in filter semantics or in how each index handles updates.
Choose Pinecone when:
- You want zero operations overhead
- You need managed infrastructure
- Budget is not a primary concern
- You want hybrid search out of the box
Choose Weaviate when:
- You need multi-modal search (text + image + audio)
- You want built-in vectorization
- GraphQL API is important
- You're building a knowledge graph
Choose Qdrant when:
- Performance is critical
- You need rich filtering
- Cost efficiency matters
- You want self-hosted option
Choose Milvus when:
- You need massive scale (billions of vectors)
- Distributed architecture is required
- Enterprise features are important
- You have DevOps resources
Production Architecture Pattern
Most teams end up with more than one store, not because a single one is inadequate but because the workloads disagree. Semantic search wants a fast graph index and tolerates approximate recall; recommendation wants a filtered scan over a changing catalogue; analytics wants to join embeddings to warehouse tables without an export step. The router below encodes that split explicitly. The rule that keeps it maintainable is one client interface per use case rather than one generic search call, so a query that needs metadata filtering cannot accidentally reach a store that applies filters after the top-k cut.
class VectorDBRouter:
"""Route queries to the best vector DB based on use case"""
def __init__(self):
self.databases = {
'search': QdrantClient("localhost", port=6333),
'recommendations': Pinecone(api_key="..."),
'multi_modal': weaviate.connect_to_local(),
'analytics': Milvus(host="localhost"),
}
async def query(self, query: VectorQuery) -> list[Result]:
# Route based on query type
if query.use_case == 'semantic_search':
db = self.databases['search']
elif query.use_case == 'recommendations':
db = self.databases['recommendations']
elif query.use_case == 'image_search':
db = self.databases['multi_modal']
elif query.use_case == 'large_scale':
db = self.databases['analytics']
return await db.search(query)
Conclusion
There's no single "best" vector database. The choice depends on your specific needs:
- Pinecone for managed simplicity
- Weaviate for multi-modal and knowledge graphs
- Qdrant for performance and cost efficiency
- Milvus for massive scale and enterprise features
For most startups, Qdrant offers the best balance of performance, features, and cost. For enterprises needing managed infrastructure, Pinecone is the safe choice. For multi-modal AI, Weaviate is unmatched.
A migration is cheaper than it looks if you plan for it from day one: keep a thin client wrapper over the store, keep the source text and metadata in a system you control, and re-embed from that source rather than exporting vectors. Re-embedding 10M documents at a throughput of about 750 per second takes roughly 3.7 hours, which is an overnight job rather than a project. What cannot be recovered is the tuning you did on one index's parameters, so record filter selectivity, recall at 10 against exact search, and p99 under load for the configuration you actually run.
Common Mistakes
Benchmarking on an empty index with no metadata filters and expecting production latency
Fix: Load the real corpus, apply the filters your queries use, and measure p99 on a warm and a cold index separately
Choosing a store on the monthly price at 1M vectors, then discovering the bill at 500M
Fix: Model cost at your twelve-month projection including replication, then confirm the filter behaviour that projection assumes
Trapping application code in vendor-specific query calls so a migration becomes a rewrite
Fix: Wrap the store behind one client interface per use case, and keep source text and metadata in a system you own
Key Takeaways
- Exact nearest neighbour over 100M vectors at 768 float32 dimensions is about 307 GB and 154 ms, which is why every product stores an approximate index instead
- Recall must be measured against exact search on your own sample, because index parameters interact with corpus size, dimension, and metric
- Read p99 rather than p50: the tail is what users feel and what autoscalers react to, and a cold index can double it after a restart
- Keep a client wrapper and the source text you own, so changing stores costs a re-embed of a few hours rather than a rewrite