UK’s trusted IT infrastructure partner since 2003
Servnet
FinanceToolsConfiguratorGet in Touch
AI Infrastructure

What Is a Vector Database? Embeddings & Search

Servnet Editorial · IT infrastructure analysis6 min read
Share

To answer what is a vector database, one must look past marketing hype to the underlying data structures: systems engineered to store, index, and query mathematical representations of meaning called embeddings. While conventional relational databases match exact text strings, vector search calculates mathematical proximity across high-dimensional spaces to retrieve contextually relevant results. For enterprise teams building semantic search or Retrieval Augmented Generation (RAG) explained workflows, the architectural debate in 2026 centres on hardware footprint and complexity. Approximate nearest-neighbour indexes such as HNSW demand significant memory, which in turn encourages many teams to ask whether extending an existing PostgreSQL stack via pgvector could offer a lower operational burden than deploying and maintaining a dedicated vector platform.

Similarity Search Query Specification Layer
5Return LimitTop k nearest neighbour rows specified by LIMIT4Target Query VectorHigh-dimensional embedding generated from input text3Distance Function OperatorSelected metric: L2, inner product, cosine, or L12Target Embedding ColumnDatabase column containing pre-calculated vectors1Relational Source TableUnderlying database table storing unified entity…
View the data behind this chart
Similarity Search Query Specification Layer
LayerDetail
Return LimitTop k nearest neighbour rows specified by LIMIT
Target Query VectorHigh-dimensional embedding generated from input text
Distance Function OperatorSelected metric: L2, inner product, cosine, or L1
Target Embedding ColumnDatabase column containing pre-calculated vectors
Relational Source TableUnderlying database table storing unified entity…

What is a vector database? The core concept explained

In plain terms, a vector database stores embeddings—numeric representations of meaning—and uses similarity search to find the nearest vectors rather than exact keyword matches. It is an operational storage engine designed specifically to store, index, and query high-dimensional numeric arrays known as vector embeddings. In conventional relational databases, queries rely on structured filters or exact lexical matching—locating rows where an exact string or numerical range matches a query clause. In contrast, vector engines execute similarity search, calculating the spatial distance between a target query vector and stored data points to return the closest semantic neighbours.

As organisations deploy artificial intelligence across internal estates in 2026, unstructured information such as technical manuals, customer support tickets, transcripts, and operational documentation increasingly needs to be made accessible to machine learning models. For example, in semantic search or retrieval-augmented generation (RAG) across customer support tickets or product documentation, a vector database finds relevant materials based on meaning even when a search query uses different vocabulary. Vector databases provide the mathematical retrieval layer that underpins modern semantic search and generative AI pipelines, identifying conceptual overlap even when the query shares zero identical keywords with the stored corpus.

Illustration: What Is a Vector Database? Embeddings & Search

Understanding embeddings: The foundation of semantic search

Embeddings are dense arrays of numbers generated by machine learning models that encode the contextual meaning of unstructured data into a high-dimensional mathematical space. When text is processed through an embedding generation step—such as using an embedding() function before database ingestion—the model maps linguistic semantics into hundreds or thousands of floating-point values. Within this vector space, concepts with similar real-world meanings are placed in close proximity to one another.

It is critical to distinguish embedding generation from vector storage. Generation is an algorithmic inference step executed by an external machine learning model or an embedded database function. The database itself is responsible for persistent storage, indexing, and high-speed retrieval. Once unstructured data is converted into vectors, the database evaluates geometric distance using mathematical distance metrics, identifying the nearest records to serve downstream applications.

How vector databases work: Indexing and distance metrics

Vector retrieval relies on calculating the geometric separation between a target query vector and indexed vectors. Open-source extensions such as pgvector document support for six fundamental distance metrics: L2 distance (Euclidean distance), inner product, cosine distance, L1 distance (Manhattan distance), Hamming distance, and Jaccard distance. Selecting the appropriate metric depends directly on how the upstream embedding model normalised its vectors during training.

To execute a query, modern vector layers support two primary search modalities: exact nearest-neighbour search and approximate nearest-neighbour (ANN) search. In practical terms, exact search computes distances against all records in the table, which avoids approximation but becomes slower as datasets grow. In contrast, approximate nearest-neighbour search trades some recall for speed, allowing systems to navigate dense multi-dimensional graphs without calculating distances across every row. For larger workloads, approximate indexes such as HNSW are commonly used.

Building these indexes can incur substantial computational and memory overhead. Approximate nearest-neighbour indexes such as HNSW are often memory-hungry and can be expensive to build. This architectural reality was highlighted by AWS in Aurora's support for pgvector version 0.7.0, which specifically introduced parallelised HNSW index builds to mitigate heavy ingestion overheads.

  • L2 Distance (Euclidean): Measures straight-line spatial distance between coordinate points.
  • Cosine Distance: Evaluates the angular divergence between vectors, disregarding absolute magnitude.
  • Inner Product: Assesses projection alignment, frequently utilised for pre-normalised models.
  • Exact Search: Brute-force scanning across all entries, eliminating index build overhead at the expense of query latency.
  • Approximate Search (HNSW): Graph-based vector clustering that delivers low-latency retrieval while consuming substantial RAM.

The query lifecycle: Running similarity searches

In production environments, executing a vector query involves a structured sequence of operational parameters. As documented in Google Cloud's AlloyDB operational guidance, a standard similarity search requires five distinct inputs: the target table, the designated embedding column, the distance function, the target embedding vector, and the exact number of rows to return.

A common query pattern is to order by vector distance and use LIMIT to return the top k nearest neighbours. In PostgreSQL with pgvector, this entire workflow executes directly within standard SQL queries, enabling engineering teams to combine semantic proximity scoring with standard relational WHERE filters in a single execution plan.

Postgres with pgvector vs dedicated vector engines

The prevailing infrastructure dilemma for UK enterprises in 2026 is choosing between integrated relational vector extensions and dedicated vector platforms. The open-source pgvector extension brings semantic search directly into PostgreSQL, storing high-dimensional vectors in standard database tables alongside relational business data rather than in a separate system. This integrated approach allows organisations to avoid deploying and synchronising an independent vector service, making it simpler to combine vector search with existing relational tables, metadata filters, and joins.

However, hardware resources dictate where this approach reaches its limits. Because graph-based vector indexes like HNSW are memory-sensitive, mid-sized engineering teams should evaluate system sizing and memory headroom. Running large vector indexes inside PostgreSQL may require substantial host RAM to keep index pages and database buffers performing well. For modest datasets and retrieval workflows, pgvector is often enough; but as estates grow or latency and operational demands increase, a dedicated vector database may become worth evaluating.

Vector Search Execution Modes in PostgreSQL
Search ModeResource ProfileOperational…Exact Nearest SearchBrute Force ScanZero Index RAM RequiredFull Recall But High…HNSW Approximate IndexGraph-Based ANNHeavy Memory & Build CostFast Queries With Minor…Parallelised HNSW…Multi-Core BuildHigh CPU & Memory SpikesMuch faster builds (AWS…
View the data behind this chart
Vector Search Execution Modes in PostgreSQL
Search ModeResource ProfileOperational…
Exact Nearest SearchBrute Force ScanZero Index RAM RequiredFull Recall But High…
HNSW Approximate IndexGraph-Based ANNHeavy Memory & Build CostFast Queries With Minor…
Parallelised HNSW…Multi-Core BuildHigh CPU & Memory SpikesMuch faster builds (AWS…

Hardware sizing, memory footprints, and UK infrastructure planning

For UK organisations operating under strict budgets and stringent compliance mandates, hardware provisioning for vector workloads requires disciplined capacity planning. Approximate nearest-neighbour indexes are often memory-sensitive, so moving too much of the working set to disk can hurt latency. When evaluating RAG infrastructure requirements, systems architects must size memory headroom not merely for the baseline vectors, but for the index graph overheads and concurrent query working memory.

When procuring storage solutions for AI and analytics, UK technology leaders must balance total cost of ownership against architectural complexity. For mid-sized UK firms, extending an existing, fully managed PostgreSQL estate using pgvector can help avoid additional proprietary vector service subscriptions, extra managed service complexity, and some separate data-transfer pipelines. Infrastructure teams should budget for sufficient memory headroom on host servers to maintain index performance while evaluating whether specific workloads actually demand dedicated vector hardware.

Data governance, security, and UK GDPR compliance

Data privacy and regulatory compliance represent a critical decision boundary for UK enterprises implementing vector-enabled retrieval systems. Storing embeddings in third-party hosted systems can create data residency and transfer considerations that need legal review.

Keeping vector storage inside an existing relational database can simplify governance and operational controls. Storing embeddings in PostgreSQL can let organisations reuse existing access controls, encryption, auditing, and retention processes.

Decision framework: When is pgvector enough?

Selecting between an integrated database extension and an independent vector platform should be dictated by data scale, team operational maturity, and query complexity rather than platform vendor marketing. Mid-market UK firms can avoid substantial overhead by following a pragmatic evaluation framework.

PostgreSQL with pgvector represents the optimal production default when the organisation already maintains a PostgreSQL operational footprint, requires relational joins between embeddings and transactional metadata, and operates within moderate dataset boundaries. A shift to a dedicated vector architecture is warranted only when vector ingestion rates saturate database worker pools, when latency targets require specialised distributed vector hardware, or when index memory footprints fundamentally destabilise core transactional database workloads.

Sources

Every figure in this article traces to the sources below.

  • pgvector GitHub Repository — Extension specifications and supported distance metrics
  • Google Cloud AlloyDB Documentation — Vector similarity search operational requirements
  • Google Cloud Architecture Guides — Semantic search mechanics and pgvector capabilities
  • AWS Database Blog — Amazon Aurora support for pgvector 0.7.0 and HNSW build parallelism
Integrated Vector Processing Architecture
Embedding FunctionTranslates text to…Postgres TableStores vectors with dataDistance MetricL2, Cosine, or Inner…Top K RetrievalOrdered nearest…
Share
Key takeaways
  • Vector databases store embeddings—numeric representations of meaning—and execute similarity searches rather than exact keyword matches.
  • A standard similarity search requires five core inputs: target table, embedding column, distance function, query vector, and row limit.
  • The open-source pgvector extension supports six documented distance metrics: L2, inner product, cosine, L1, Hamming, and Jaccard.
  • HNSW vector indexes are RAM-hungry; AWS Aurora highlights that pgvector 0.7.0 adds parallelism to HNSW index builds to accelerate what can otherwise be a costly index construction process.
  • For mid-sized UK firms, pgvector avoids separate data pipelines and simplifies UK GDPR compliance by keeping vectors inside existing Postgres tables.
Frequently asked

FAQs — What Is a Vector Database? Embeddings & Search

What is the difference between an embedding and a vector database?

An embedding is a numeric vector generated by a machine learning model to capture the semantic meaning of data. A vector database is the storage and retrieval engine that stores these arrays, builds fast search indexes, and computes mathematical similarity between query vectors and stored records.

How does similarity search differ from traditional database search?

Traditional relational databases rely on exact matches or lexical patterns within structured tables. Similarity search calculates geometric distances across high-dimensional vector spaces, retrieving results that share conceptual meaning with the query even if they contain completely different vocabulary.

What distance metrics does pgvector support?

According to the official pgvector documentation, the extension supports six distance metrics: Euclidean (L2) distance, inner product, cosine distance, L1 distance, Hamming distance, and Jaccard distance, allowing alignment with various model training configurations.

What are the hardware trade-offs of approximate nearest-neighbour indexes?

Approximate nearest-neighbour indexes such as HNSW drastically improve query speed compared to brute-force exact search, but they consume substantial system RAM. Building these graph indexes requires heavy computational overhead, which releases like pgvector 0.7.0 address via parallel processing.

Why is pgvector often enough for mid-size UK companies?

pgvector stores high-dimensional vectors directly inside existing PostgreSQL tables. This architecture allows teams to query embeddings alongside relational data, avoid third-party software subscriptions, and maintain data sovereignty under UK GDPR without standing up separate infrastructure.

Related

Got a question this article didn't answer?

One conversation with an engineer who's done this before. No sales script.

Talk to Servnet →

Talk to a UK specialist

Get expert advice or a no-obligation quote — servers, storage, networking, maintenance, finance and cloud. We reply the same working day.

or call 0800 987 4111