# Vector Database

A vector database stores and searches vector representations so applications can retrieve items by similarity alongside metadata constraints.

- Type: term
- Domain: Engineering & architecture
- Level: Intermediate
- Last reviewed: 2026-10-05
- Original: [Soroush’s Product Wiki](<https://wiki.soroush.uk/topic/vector-database/>)

## What it means

A vector database manages vectors, their identifiers, and associated metadata, with operations for similarity search and data updates. Vector store is often used for the same role. The capability may live in a dedicated service, a search engine, or an extension to an existing database. It is retrieval infrastructure; semantic search is a use of that infrastructure, and an embedding model produces the representations.

## Why it matters

Infrastructure choices affect relevance, freshness, access control, operating cost, and migration effort. Product teams should evaluate the whole retrieval workflow rather than assume that a separate database is necessary whenever embeddings are used.

## When to use it

Use vector storage and search when similarity retrieval needs persistent data, filtering, updates, and predictable performance. Small collections may need only a simple exact search. An existing database with vector support may meet requirements without introducing another service.

## How it works

1. Define retrieval tasks, data volume, update frequency, latency needs, and authorization boundaries.
2. Choose compatible embedding representations and store each vector with a source identifier, model version, and useful metadata.
3. Compare exact and approximate search on realistic queries, measuring retrieval recall as well as speed.
4. Test filters, tenant isolation, deletion, and freshness under actual access rules and update patterns.
5. Plan backups, monitoring, and re-embedding or index migration when representations change.

## A practical example

A B2B help center needs semantic retrieval across customer-specific manuals. The team compares a vector extension in its current database with a dedicated service. It tests restrictive account filters and frequent article updates before choosing the option that meets retrieval quality and operational needs at its current scale.

## Where it breaks

Nearest vectors are not necessarily authoritative or factually relevant. Approximate indexes can miss useful results, and restrictive filters may affect recall. Embedding changes can require reprocessing content. Vector retrieval alone provides neither document permissions nor a grounded answer.

## Common mistakes

- Assuming a dedicated vector service is mandatory for retrieval-augmented generation.
- Comparing speed without checking recall under real filters.
- Mixing vectors from incompatible embedding models.
- Deleting source content while leaving searchable vectors or cached copies available.

## Visualization

[View the visualization on the website](<https://wiki.soroush.uk/topic/vector-database/#visualization-vector-database>)

## Sources

1. [pgvector](<https://github.com/pgvector/pgvector>) — pgvector contributors · Official documentation
2. [Vector search in Azure AI Search](<https://learn.microsoft.com/en-us/azure/search/vector-search-overview>) — Microsoft Learn · Official documentation

## Related topics

- [Embedding](<https://wiki.soroush.uk/topic/embedding/>)
- [Semantic Search](<https://wiki.soroush.uk/topic/semantic-search/>)
- [Database](<https://wiki.soroush.uk/topic/database/>)
