Analytics Updated: 2026-02-27

What is Vector Database?

A database optimized for storing and searching high-dimensional vectors (embeddings), enabling semantic search, RAG pipelines, and AI-powered applications.

From the field

Five years ago, vector databases were a niche concern. Now, if you're building anything with an LLM, you probably need one — or at least need vector search in whatever database you already use. The category exists for one reason: LLMs have bounded context windows and poor factual recall, so you need a way to retrieve "the right chunks" from your own knowledge and stuff them into the prompt. Vector similarity search is how you do that at scale.

The decision I actually face

Most teams overthink vector DB selection. The real question in 2026 isn't "Pinecone vs. Weaviate vs. Milvus" — it's "do I need a dedicated vector DB at all, or will my existing database's vector support do the job?" For most teams with <10M vectors: Postgres + pgvector, Snowflake's VECTOR_COSINE_SIMILARITY, or Elasticsearch's kNN search is enough. You skip an entire piece of infrastructure. Dedicated vector DBs start to pay off when you have hundreds of millions of vectors, need sub-50ms p99 at high QPS, or want features like hybrid search (vector + BM25) baked in.

A quick field story

On one project we built a RAG pipeline for internal documentation — ~200K chunks, maybe 50 queries/minute. The team's first instinct was Pinecone ("it's the default!"). Cost estimate: ~$70/month. We ended up using pgvector on the Postgres we already had — index build took 3 minutes, queries returned in 15-30ms, and the incremental cost was zero because the RDS instance was already there. Six months later, nothing has forced us off pgvector. The point isn't that Pinecone is wrong; it's that "you need a vector database" is a much weaker statement than "you need vector search." For a lot of RAG workloads, the latter can be solved inside your existing stack.

A Vector Database is a specialized database designed to store, index, and query high-dimensional vectors (also called embeddings). These vectors are numerical representations of unstructured data — text, images, audio — generated by AI models. Vector databases power the retrieval layer of AI applications like RAG (Retrieval-Augmented Generation), semantic search, and recommendation engines.

How Vector Databases Work

1. EMBED: Convert data to vectors using AI models
   "Snowflake Architecture" → [0.23, -0.45, 0.78, ...] (768 dimensions)

2. STORE: Index vectors for fast similarity search
   Vector DB stores millions of vectors with metadata

3. QUERY: Find similar vectors using distance metrics
   "cloud data warehouse" → Find top 10 most similar documents

Why Vectors Matter

Traditional databases search by exact match (WHERE name = 'John'). Vector databases search by similarity — finding items that are conceptually close, even if they share no keywords.

Traditional SearchVector Search
WHERE title LIKE '%snowflake%'Find articles about cloud data warehousing
Exact keyword matchingSemantic meaning matching
Misses synonyms and contextUnderstands intent and relationships

Key Concepts

Embeddings

Numerical vectors that capture the semantic meaning of data:
  • Text: Generated by models like OpenAI Ada, Cohere, Snowflake Arctic
  • Images: Generated by CLIP, ResNet
  • Dimensions: Typically 256 to 1536 floating-point numbers

Similarity Metrics

  • Cosine Similarity: Angle between vectors (most common for text)
  • Euclidean Distance: Straight-line distance
  • Dot Product: Combination of direction and magnitude

Indexing Algorithms

  • HNSW (Hierarchical Navigable Small World): Fast, accurate, memory-intensive
  • IVF (Inverted File Index): Good balance of speed and memory
  • PQ (Product Quantization): Compressed vectors for huge datasets

Popular Vector Databases

DatabaseTypeBest For
PineconeManaged SaaSProduction RAG, zero-ops
WeaviateOpen SourceHybrid search (vector + keyword)
MilvusOpen SourceMassive scale (billions of vectors)
QdrantOpen SourceRust-based performance
ChromaOpen SourceLocal development, prototyping
pgvectorPostgreSQL ExtensionAdding vectors to existing Postgres
Snowflake CortexIntegratedSnowflake-native RAG

Use Cases

  1. RAG (Retrieval-Augmented Generation): Feed relevant context to LLMs
  2. Semantic Search: Find results by meaning, not keywords
  3. Recommendation Engines: Suggest similar products/content
  4. Image Search: Find visually similar images
  5. Anomaly Detection: Identify data points far from normal patterns

Key Points

Gotchas

Hard-won lessons from building RAG in production:

  • Embedding model choice matters more than DB choice. A mediocre embedding on a great vector DB gives worse retrieval than a strong embedding on a basic vector store. Spend 80% of your optimization effort on the embedding + chunking strategy, 20% on the DB.
  • Dimensions are not free. A 1536-dim OpenAI embedding at 4 bytes per dim = 6KB per vector. 10M vectors = 60GB just for the vectors, before index overhead. Product quantization (PQ) and binary quantization are how large vector DBs keep memory in check; enable them before scaling past ~1M vectors.
  • Hybrid search usually beats pure vector search. Most production RAG systems combine vector similarity + BM25/lexical search + metadata filters. Pure vector search misses exact-match queries (proper nouns, SKUs, IDs) where keyword search wins. Weaviate, OpenSearch, and pgvector + Postgres full-text can all do hybrid.
  • Reindexing is expensive. Changing your embedding model means regenerating every vector. For large corpora this is a multi-day, multi-dollar operation. Pick an embedding model you're comfortable sticking with for 12+ months, or budget for re-embeds.
  • Metadata filtering has huge performance implications. Filtering by tenant_id or date > X before vector search (pre-filter) is much faster than post-filter, but requires the DB to support it efficiently. Test your filter patterns at scale before committing.
  • Don't forget recall vs. latency tradeoffs. ANN algorithms (HNSW, IVF) trade recall for speed. A 95% recall@10 setting may be fine for RAG but terrible for anti-fraud matching. Tune ef_search/nprobe to your workload and monitor recall drift as your data grows.

Frequently Asked Questions

What is a vector database in simple terms?

A vector database stores data as lists of numbers (vectors) that represent the meaning or features of text, images, or other content, and lets you find items with similar meaning by comparing those vectors mathematically. Instead of searching for exact keyword matches, you search for conceptual closeness — "find me documents that talk about anything similar to this paragraph." This is the core capability that makes retrieval-augmented generation (RAG) and semantic search work: you embed text into vectors with an AI model, store the vectors, and at query time find the nearest neighbors.

Why do you need a vector database for AI?

Large language models have two problems: a limited context window (they can't read your whole knowledge base) and a tendency to hallucinate (make up facts). Vector databases solve both by acting as long-term memory: you embed your organization's documents, store them, and at query time retrieve only the chunks most relevant to the user's question, then hand those to the LLM. This is the RAG pattern, and it dramatically improves factual accuracy while staying within model context limits. Without a vector store, you either shrink your knowledge base to fit in-context or accept hallucinations.

How is a vector database different from a regular database?

Regular databases (Postgres, MySQL, Snowflake) excel at exact match and range queries — WHERE id = 5, WHERE date > '2025-01-01'. Vector databases specialize in approximate nearest-neighbor (ANN) search: given a query vector, find the K most similar stored vectors using distance metrics like cosine similarity. They use indexes like HNSW or IVF that are built for high-dimensional similarity rather than the B-trees used by relational databases. In practice, many modern databases (Postgres via pgvector, Snowflake via VECTOR types, MongoDB, Elasticsearch) now support vector search alongside their traditional queries, blurring the category line.

Can Snowflake be used as a vector database?

Yes. Snowflake added native VECTOR types, VECTOR_COSINE_SIMILARITY / VECTOR_L2_DISTANCE functions, and Cortex Search — a managed hybrid (vector + keyword) search service. For teams already on Snowflake, this is often the easiest path: your embeddings live next to your other data, you use one governance model, and you avoid a separate vector infrastructure. The tradeoff vs. dedicated vector DBs: Snowflake's query latency is warehouse-scale (~100ms-1s) which is fine for batch and some interactive workloads but not for ultra-low-latency (sub-50ms) real-time serving at high QPS.

Pinecone vs Weaviate vs Milvus — which should I pick?

Pinecone is the fully managed SaaS option — easiest to operate, no infrastructure to manage, strong at pure vector search; costs can scale up fast. Weaviate is open source with excellent hybrid search (vector + BM25) and built-in modules for common AI workflows; available self-hosted or as Weaviate Cloud. Milvus is open source, built for massive scale (billions of vectors), strongest when you have huge corpora and want to self-host. For most teams starting out, the real decision is whether to use any of them vs. pgvector/Cortex on existing infrastructure. Dedicated vector DBs pay off when scale, latency, or feature needs exceed what a general database can do.

What is HNSW and why does it matter?

HNSW (Hierarchical Navigable Small World) is the dominant indexing algorithm for vector search. It builds a multi-layer graph where similar vectors are connected, letting queries find approximate nearest neighbors in sub-linear time. Tradeoffs: HNSW is fast and accurate but memory-heavy (often 2-3x the raw vector size) and slow to build. Alternatives: IVF (Inverted File) is cheaper but less accurate; PQ (Product Quantization) compresses vectors aggressively for huge datasets. Most vector DBs default to HNSW because the accuracy/speed profile fits most workloads. Tune parameters `M` (graph connectivity) and `ef_construction`/`ef_search` for your recall and latency needs.

Is pgvector good enough for production?

Usually, yes. pgvector is a Postgres extension that adds vector types and HNSW/IVF indexes to standard Postgres. It's production-used at meaningful scale — millions to tens of millions of vectors — and inherits all of Postgres's strengths: transactions, SQL joins, metadata filtering, existing ACL, existing ops. Where it falls short vs. dedicated vector DBs: performance past ~50-100M vectors, built-in hybrid search (you combine with Postgres full-text search yourself), and features like multi-tenancy or namespace isolation. For most teams building their first RAG system, pgvector is the right starting point — add a dedicated vector DB only when you have measured reason to.

Related Terms

Data WarehouseApache SparkOLAP (Online Analytical Processing)

Related Tools

PineconeWeaviateMilvusQdrantSnowflake Cortex

Learn More

Browse All Terms Read Articles