Advanced Topic 51 of 51 Databases
Vector Databases
Stores indexing embeddings for similarity search.
How it works
Vector databases store high-dimensional embedding vectors produced by machine-learning models and find the most similar ones to a query vector using a distance such as cosine similarity, dot product or Euclidean distance. Exact search is too slow at scale, so they use approximate nearest neighbor indexes such as HNSW graphs, IVF with product quantization and locality-sensitive hashing, trading small accuracy loss for large speedups. Metadata filters combine similarity with conditions.
Step-by-step walkthrough
- Content is turned into a vector by an embedding model.
- Similar meaning gives nearby vectors.
- The vectors are stored in an index such as HNSW.
- A query vector finds the nearest neighbours.
- Search by meaning powers retrieval for AI applications.
Where it is used
Semantic search, recommendation, image and audio similarity, deduplication and retrieval-augmented generation for language models use vector databases such as Pinecone, Milvus, Weaviate and pgvector.
Common pitfall
Results depend on the quality of embeddings and the chosen model, and mixing embeddings from different models is meaningless. Approximate indexes can miss true neighbors, so tune recall and latency. Index memory needs are large, and updates can be costly. Evaluate with real queries and relevance judgments, and consider simple keyword search combined with vectors.
Where it fits in the course
Vector Databases is topic 51 of 51 in Databases, rated Advanced. It follows Time-Series Databases. It is the last topic in this area.
Practice and explore
- Open the interactive lesson, with a mini quiz.
- Take the Databases quiz.
How to study this topic
- Read the explanation above and restate the definition in your own words.
- Open the interactive lesson and answer its mini quiz.
- Read the common pitfall, then write a short example that avoids it.
- Check your understanding in the Databases quiz, and revisit the topic if you miss a question.
Frequently asked questions
What is Vector Databases?
Where do people use Vector Databases?
What is the most common mistake with Vector Databases?
What should I learn before this topic?
How can I practice it?
Is Vector Databases hard to learn?
How long does it take to learn Vector Databases?
Which topics are related to Vector Databases?
What should I study after Vector Databases?
Related topics
- Time-Series Databases (Databases)
- NewSQL and Distributed SQL (Databases)
- LSM Trees (Databases)
- OLTP vs OLAP (Databases)
- Raster vs Vector Graphics (Graphics, Vision & Media)
- Support Vector Machines (AI & Machine Learning)
- SIMD and Vector Processing (Computer Architecture & Logic)