Vector Databases
PART 16 — Vector Databases¶
Standard SQL databases find exact matches. Vector databases find similar meanings.
- Similarity Search: Finding vectors closest to the query vector in high-dimensional space.
- ANN (Approximate Nearest Neighbor): Mathematically, comparing a query to 1 billion vectors takes too long. ANN uses clever indexing graphs (like HNSW) to find a good enough match instantly.
- Metadata Filtering: Combining vector search with standard SQL filters (e.g., "Find documents similar to 'AI' WHERE date > 2024").
Why does an HLD engineer care?¶
Vector databases introduce a fundamental trade-off: Recall vs Latency. Perfect recall (comparing everything) is too slow. ANN is fast but might miss the absolutely perfect chunk. Selecting and scaling a Vector DB is a core HLD task.