A vector database stores data as high-dimensional number arrays (embeddings) and finds similar items by comparing those numbers. Unlike regular databases that match exact values, vector databases find things by meaning.
Why AI needs them
When you search a regular database for “memory leak fix,” it only finds rows containing those exact words. A vector database finds results about “RAM overflow,” “garbage collection issues,” and “heap exhaustion” — because they mean similar things.
This is the foundation of RAG systems, AI search engines, and recommendation systems.
How it works
"The server is running out of memory"
↓ embedding model
[0.023, -0.041, 0.089, ...] (1536 numbers)
↓ stored in vector DB
↓ compared to query vectors using cosine similarity
↓ returns most similar documents
Popular vector databases
| Database | Type | Best for |
|---|---|---|
| Pinecone | Fully managed | Zero-ops production |
| Qdrant | Open source | Best performance |
| Weaviate | Open source | Hybrid search |
| Chroma | Open source | Prototyping |
| pgvector | Postgres extension | Already using Postgres |
See our detailed comparison for benchmarks and pricing.
When to use one
- Building AI search or RAG
- Recommendation systems (“similar items”)
- Duplicate detection
- Image/audio similarity search
When NOT to use one
- Simple CRUD operations (use PostgreSQL or MongoDB)
- Exact lookups by ID
- Relational queries with JOINs
- Under 10K documents (full-text search is fine)
Related: Vector Databases Compared · Embeddings Explained · What is RAG?