Vector Databases
From SQL to Semantic Search
Amrit Gopinath
CSE-A | SSNCE
April 23, 2026
Amrit Gopinath (CSE-A | SSNCE) Vector Databases April 23, 2026 1 / 14
Agenda
1 Traditional Databases & Their Limitations
2 What is a Vector / Embedding?
3 How Vector Databases Work
4 Indexing Algorithms (HNSW, IVF+PQ)
5 Popular Vector Databases
6 Live Demo
7 Real-World Use Cases
8 CAP Theorem Applied to Vector Databases
9 PACELC Applied to Vector Databases
10 Key Takeaways
Amrit Gopinath (CSE-A | SSNCE) Vector Databases April 23, 2026 2 / 14
Traditional Databases
Where They Struggle
What They Do Well Cannot understand semantic
meaning
Store structured data in rows
& columns Poor at similarity / fuzzy
search
CRUD operations with SQL
Not designed for unstructured
ACID-compliant transactions
data
Joins & relational queries
Scalability issues with high-dim
Exact-match lookups (fast & data
reliable)
No native support for
embeddings
Amrit Gopinath (CSE-A | SSNCE) Vector Databases April 23, 2026 3 / 14
What is a Vector / Embedding?
Definition
An embedding converts any data (text, image, audio) into a list of
numbers that captures its semantic meaning in a high-dimensional space.
Conversion Pipeline:
model
“A cat sat on the mat” −−−→ [0.23, −0.11, 0.87, . . .]
Distance Metrics
Key Properties
Cosine — angle between
Similar items → vectors close
vectors
together
Euclidean (L2) —
Distance = semantic difference
straight-line distance
Models trained on billions of
Dot Product — magnitude +
data points
direction
Amrit Gopinath (CSE-A | SSNCE) Vector Databases April 23, 2026 4 / 14
How Vector Databases Work
1 Ingest & Embed — Raw data passed through an embedding model
(e.g. OpenAI ada-002, BERT, sentence-transformers).
2 Index Vectors — Stored using ANN index structures (HNSW, IVF)
optimised for fast retrieval.
3 Query — User query embedded with the same model, producing a
query vector.
4 Nearest-Neighbour Search — DB finds top-k most similar vectors
using the chosen distance metric.
5 Return Results — Matching documents returned with metadata and
similarity scores.
Critical Rule
The same embedding model must be used at both insert time and query
time.
Amrit Gopinath (CSE-A | SSNCE) Vector Databases April 23, 2026 5 / 14
Indexing Algorithms
HNSW
IVF + PQ
Hierarchical Navigable Small World
Inverted File Index + Product
Quantization
Graph-based multi-layer index
Clusters vectors with k-means
O(log n) search complexity
Searches only relevant clusters
Best recall-vs-speed tradeoff
PQ compresses vectors → less
Used by: Weaviate, Qdrant, RAM
FAISS
Used by: FAISS, Milvus
High memory usage but very
Great for billion-scale datasets
fast
Tradeoff: HNSW = better recall | IVF+PQ = lower memory
footprint
Amrit Gopinath (CSE-A | SSNCE) Vector Databases April 23, 2026 6 / 14
Popular Vector Databases
Database Type Best For
Pinecone Managed cloud Production RAG apps
Weaviate Open-source Hybrid BM25 + vector search
ChromaDB Open-source Local dev & learning
FAISS Library (Meta) Raw speed, research
Qdrant Open-source High-perf with rich filtering
Milvus Open-source Billion-scale enterprise
For Beginners
Start with ChromaDB — zero setup, Python-native, runs in-process.
Amrit Gopinath (CSE-A | SSNCE) Vector Databases April 23, 2026 7 / 14
Use Case: RAG — Retrieval Augmented Generation
The Problem
LLMs like GPT-4 don’t know your private documents. Vector DBs fix this.
RAG Pipeline:
embed retrieve
| {zDocs} −−−−→
Your |Vector
{z DB} −−−−→ LLM
|{z} → Answer
PDF, Word Chroma/Pinecone GPT-4/Claude
No hallucination — answers grounded in real retrieved docs
Always up-to-date — update the DB without retraining the LLM
Private & secure — documents never leave your infrastructure
Amrit Gopinath (CSE-A | SSNCE) Vector Databases April 23, 2026 8 / 14
Real-World Use Cases
Semantic Search
Fraud Detection
Notion, Slack — finds results by
Banks cluster transaction vectors;
meaning, not keywords
anomalies flagged in real time
Recommendations
Drug Discovery
Netflix/Spotify compare
Molecule embeddings help find
embedding similarity to suggest
similar compounds at scale
content
Customer Support
Image Search
Route tickets by matching query
Pinterest’s visual search embeds
vectors to resolved cases
and finds similar images
Amrit Gopinath (CSE-A | SSNCE) Vector Databases April 23, 2026 9 / 14
Vector DB vs Traditional DB
Feature Traditional DB Vector DB
Data Type Structured (tables) Unstructured / embeddings
Query Type Exact match (SQL) Approximate similarity
Search Keyword / filter Semantic / contextual
Scalability Vertical Horizontal (distributed ANN)
Use Case ERP, banking, CRM AI apps, RAG, recommenders
Examples MySQL, PostgreSQL Pinecone, Weaviate, Chroma
Amrit Gopinath (CSE-A | SSNCE) Vector Databases April 23, 2026 10 / 14
CAP Theorem — Applied to Vector Databases
Database CAP Reason
Pinecone AP Upserted vectors not immedi-
ately searchable; eventually con-
sistent
Weaviate Configurable Tunable via replication factor
and consistency level (ONE /
QUORUM / ALL)
Milvus CP Uses etcd + write-ahead log; re-
fuses writes during partition
ChromaDB N/A Single-node only; CAP does not
apply
FAISS N/A In-process library; no distribution
Amrit Gopinath (CSE-A | SSNCE) Vector Databases April 23, 2026 11 / 14
PACELC — Applied to Vector Databases
| → {z
P A vs C} else |L vs
{z C}
During Partition Normal Operation
Database PACELC Explanation
Pinecone PA / EL Availability + low latency; async index updates
Weaviate Configurable Tunable toward PC/EC with QUORUM reads
Milvus PC / EC Consistency always; higher write latency
Cassandra PA / EL Classic reference point for this quadrant
MySQL PC / EC Strong consistency; higher latency
Why EL is natural for Vector DBs
Rebuilding an HNSW graph on every write is expensive. Most systems
batch index updates asynchronously — an inherent latency-consistency
Amrit Gopinath (CSE-A | SSNCE) Vector Databases April 23, 2026 12 / 14
Key Takeaways
1 Traditional DBs aren’t enough
SQL cannot perform semantic similarity search needed for modern AI.
2 Embeddings are the bridge
Any data type can be converted to a vector capturing semantic
meaning.
3 ANN makes it fast
Algorithms like HNSW enable sub-millisecond search over millions of
vectors.
4 RAG is the killer app
Vector DBs power LLM apps by grounding answers in real retrieved
context.
5 Vector DBs are mostly AP / EL
They trade consistency for availability and low latency by design.
6 PACELC extends CAP
Even without failures, every DB trades latency against consistency.
Amrit Gopinath (CSE-A | SSNCE) Vector Databases April 23, 2026 13 / 14
Thank You
Questions?
Amrit Gopinath | CSE-A | SSNCE
Amrit Gopinath (CSE-A | SSNCE) Vector Databases April 23, 2026 14 / 14