n4nAI

Comparing Haystack document stores for production RAG

A head-to-head comparison of Haystack document stores for production RAG: Elasticsearch, OpenSearch, Pinecone, Weaviate, Qdrant, Milvus, and Chroma.

n4n Team5 min read991 words

Audio narration

Coming soon — every post will get a voice note here.

If you need to compare haystack document stores production readiness, you are really weighing tradeoffs between managed vector APIs and self-hosted search engines. This head-to-head covers the seven stores that survive real RAG traffic: Elasticsearch, OpenSearch, Pinecone, Weaviate, Qdrant, Milvus, and Chroma.

The candidates

Haystack abstracts document storage behind a common interface, but the underlying systems differ sharply. Elasticsearch and OpenSearch are Lucene-based search engines with vector extensions. Pinecone is a managed proprietary vector DB. Weaviate and Qdrant are purpose-built vector databases with open-source cores. Milvus is a distributed vector engine built for massive scale. Chroma is an embedded-first store popular for prototypes.

All seven have Haystack 2.x integration packages, but maturity varies. The uniform DocumentStore API hides only so much; connection topology and index configuration will bite you later.

Comparison dimensions

Production RAG demands more than cosine similarity. You need metadata filtering, hybrid lexical+vector retrieval, predictable latency under load, and an upgrade path that doesn’t require a rewrite. Cost model matters because vector storage is not free. Ergonomics decide whether your team ships in a day or a sprint.

Head-to-head table

Store Capabilities Cost model Latency/throughput Ergonomics Ecosystem Limits
Elasticsearch Hybrid search, rich DSL filtering, nested docs Self-hosted OSS or Elastic Cloud hourly Sub-10ms ANN on warm JVM heap; scales with shards Haystack 2.x integration mature; YAML config Huge plugin ecosystem, Kibana Heavy JVM memory; tuning required for vector dims
OpenSearch Similar to ES, k-NN plugin, hybrid Self-hosted or AWS managed hourly Comparable to ES; depends on instance class Slightly behind ES in Haystack docs AWS native, alerting Fewer vector index types than ES
Pinecone Vector only, metadata filter, namespaces Per-record stored + ops usage Consistent <20ms p99 serverless Fully managed; one env var Limited outside Pinecone No lexical search; vendor lock-in
Weaviate Hybrid (BM25+vector), GraphQL, modules OSS self-host or managed tier Good; HNSW in-memory graph Python/Go client; Haystack wrapper Active community, embedding modules GraphQL learning curve; RAM heavy
Qdrant Pure vector, payload filtering, quantization OSS or Qdrant Cloud usage High throughput; quantization cuts RAM Rust core, simple REST/gRPC Growing Haystack support No built-in lexical; pair with ES for hybrid
Milvus Massive scale, partitioning, hybrid (2.x) Self-hosted complex or Zilliz cloud Higher latency at TB scale; tuned for recall Operator-based deploy; Haystack via SDK Enterprise focused Ops overhead severe for small teams
Chroma Embedded, simple API, basic filtering Local free; Chroma Cloud beta In-process fastest for small sets Easiest Haystack init Young ecosystem Not for multi-node prod yet

Capabilities: hybrid retrieval is the differentiator

Most RAG failures stem from vector-only search missing exact keywords. Elasticsearch and OpenSearch support bool queries combining match with knn. Weaviate does this via its nearVector + bm25 fusion. Pinecone and Qdrant are vector-first; you must externalize lexical search if you need it.

Metadata filtering is universal but syntactic styles differ. Elasticsearch uses term and range queries. Qdrant uses payload keys. Pinecone uses metadata expressions. All support equality and numeric range; nested object filters are ES/OS strengths.

# Elasticsearch hybrid write + retrieve sketch in Haystack 2.x
from haystack_integrations.document_stores.elasticsearch import ElasticsearchDocumentStore
from haystack import Document

store = ElasticsearchDocumentStore(hosts="http://localhost:9200", index="prod", embedding_dim=768)
store.write_documents([Document(content="Refund policy", meta={"lang": "en"}, embedding=[0.1]*768)])

If you need to compare haystack document stores production hybrid support, only ES, OpenSearch, and Weaviate ship it natively without glue code.

Cost and operational reality

Self-hosted Elasticsearch on an 8GB VM handles millions of vectors but needs JVM heap tuning. A typical cloud VM runs ~$100/month; Elastic Cloud adds premium. OpenSearch on AWS t3.medium is cheaper but you pay in operational time.

Pinecone charges per stored vector and per query. At 5M vectors expect a three-figure monthly minimum that grows with traffic. Qdrant’s scalar quantization compresses vectors 4x, slashing RAM cost on the same hardware. Milvus demands etcd, MinIO, and Pulsar—three extra systems. That’s a platform team, not a side project.

Latency and throughput characteristics

In-memory HNSW stores (Weaviate, Qdrant, Chroma) give single-digit ms queries up to a few million vectors. Elasticsearch maps vectors into off-heap structures; p99 stays low if heap is sized right. Pinecone abstracts this but cold-start on serverless can add 50ms to the first query after idle.

Throughput scales horizontally in ES/OpenSearch via shards. Qdrant uses replicas and horizontal slices. Pinecone serverless auto-scales but enforces per-second rate envelopes that surface as 429s under burst.

Ergonomics with Haystack

Haystack 2.x splits document stores into integration packages. Installing and instantiating takes minutes for Chroma:

from haystack_integrations.document_stores.chroma import ChromaDocumentStore
store = ChromaDocumentStore(persist_path="./chroma", embedding_dim=384)

For managed Pinecone:

from haystack_integrations.document_stores.pinecone import PineconeDocumentStore
store = PineconeDocumentStore(index="rag", api_key="...", dimension=1536)

The API is uniform; the difference is connection config and vector dim alignment with your embedding model. Mismatched dims throw at write time, not init.

Ecosystem and version support

Elasticsearch and OpenSearch have the longest Haystack track record. Qdrant and Weaviate caught up in 2.x with dedicated packages. Milvus support exists but lags on filter pushdown. Chroma is experimental in prod but fine for local.

When you compare haystack document stores production community support, ES/OS win on StackOverflow volume; Qdrant’s Discord is responsive. Pinecone has official guides but a single-vendor orbit.

Hard limits and operational footguns

FAISS (often asked about) has no persistence or serving layer—do not use it in production RAG. Chroma’s distributed mode is beta; expect resharding pain. Pinecone namespaces are logical, not infra-isolated. Weaviate GraphQL can surprise with depth limits. Milvus default consistency is eventual; tune consistency_level for freshness.

Elasticsearch k-NN requires dimension match at mapping creation; changing dim means reindex. Qdrant handles dim changes per-collection but still reindexes vectors. Plan migration scripts before you pick a store.

Which to choose

Prototype / single-service PoC: Chroma or local Qdrant. Zero ops, fast iterate.

Self-hosted, hybrid search required: Elasticsearch or OpenSearch. Use the k-NN plugin and a balanced shard count.

Managed, vector-only at scale: Pinecone if you accept the bill and lock-in; Qdrant Cloud if you want open-source escape hatch.

High-throughput, cost-sensitive: Qdrant with scalar quantization on a single node handles 10M vectors in 16GB RAM.

Massive dataset (100M+): Milvus or Zilliz, but staff a platform team.

Hybrid + rich metadata + observability: Elasticsearch with Kibana; you get dashboards free.

If you only need to compare haystack document stores production fit for a standard RAG app, start with Qdrant self-hosted and move to Elasticsearch when lexical search becomes mandatory.

Tagshaystackdocument-storecomparisonrag

Written by

n4n Team

The team building n4n — a single OpenAI-compatible API in front of 240+ models, with automatic fallback, load balancing and pay-per-token metering.

More from n4n Team →

All haystack document stores & retrievers posts →