If you run on Azure and you’re building a retrieval-augmented generation (RAG) application, you’ve probably noticed the problem: there isn’t one Azure vector database. There are at least seven. Microsoft’s own guide to choosing an Azure service for vector search compares six of them, and it doesn’t yet mention the newest one, Azure HorizonDB.

HorizonDB is Microsoft’s new PostgreSQL-compatible database, and Microsoft designed it with RAG as a core use case. Riya, an AI engineer on our team, spent several weeks reviewing its public preview as a RAG backend: the documentation, Microsoft’s reference pipelines, and the limits that don’t show up on the product page. This article is the result.

Our verdict: HorizonDB is a strong fit for RAG, and probably the most complete “RAG inside the database” option on Azure today. The catch is that it’s still in preview, and that changes what you should use it for.

Key takeaways

  • Azure has seven vector database options: Azure HorizonDB, Azure Database for PostgreSQL, Azure Cosmos DB for NoSQL, Azure DocumentDB, Azure AI Search, Azure SQL Database, and Azure Managed Redis.
  • Azure HorizonDB keeps the entire RAG retrieval pipeline in SQL: vector search, keyword (BM25) search, metadata filtering, reranking, graph traversal, and even ingestion pipelines.
  • Its standout feature for RAG is filtered vector search. DiskANN advanced filtering pushes WHERE clauses into the vector index, which matters for per-tenant and permission-based retrieval.
  • It is a public preview. There’s no SLA, several enterprise features are missing, and published pricing detail is thin. Prototype on it; don’t run production on it yet.
  • Plain pgvector code stays portable. If you write your retrieval layer carefully, you can start on Azure Database for PostgreSQL today and move to HorizonDB when it reaches general availability.

Does Azure have a vector database?

Yes. Azure doesn’t sell a standalone “Azure Vector Database” product. Instead, vector search is built into several Azure data services. A vector database stores embeddings (numerical representations of text, images, or other content) and finds the ones closest to a query embedding. In a RAG application, that’s how you retrieve the passages you hand to the large language model (LLM).

On Azure, you can store and search embeddings in:

  1. Azure HorizonDB (preview): cloud-native, PostgreSQL-compatible, with built-in AI functions and pipelines
  2. Azure Database for PostgreSQL: managed PostgreSQL with the pgvector and pg_diskann extensions
  3. Azure Cosmos DB for NoSQL: operational NoSQL data and vectors in one store
  4. Azure DocumentDB: MongoDB-compatible API with high-dimension vector support
  5. Azure AI Search: a separate managed search index that combines content from many sources
  6. Azure SQL Database: a native vector data type for SQL Server teams
  7. Azure Managed Redis: in-memory vector search for ultra-low latency

Which Azure vector database is best for RAG?

There’s no single best Azure vector database. The right choice depends on where your data already lives, whether you need hybrid search, and how mature the service needs to be. Here’s how the options compare, based on Microsoft’s documentation as of November 2026:

Azure service Best for Vector indexes Max dimensions Hybrid search and reranking Maturity
Azure HorizonDB RAG on relational data with filtering, reranking, and graph retrieval in one database Flat, IVFFlat, HNSW, DiskANN (recommended) 16,000 with DiskANN BM25 plus vector in SQL; built-in reranking with azure_ai.rank() Public preview, no SLA
Azure Database for PostgreSQL Teams that want a proven RDBMS today, or sharding for very large vector sets IVFFlat, HNSW, DiskANN (pg_diskann) 16,000 stored; 2,000 indexed with HNSW or IVFFlat Possible, but you write the hybrid logic yourself Generally available
Azure Cosmos DB for NoSQL Operational NoSQL apps that want vectors next to the data Flat, quantizedFlat, DiskANN 4,096 (505 with flat) BM25 plus vector with weighted RRF; semantic reranker in preview Generally available
Azure DocumentDB MongoDB-compatible apps, very high-dimension embeddings IVFFlat, HNSW, DiskANN 16,000 with DiskANN Native RRF hybrid search; no built-in reranking Generally available
Azure AI Search Search across many content sources, with integrated vectorization HNSW, exhaustive k-NN 4,096 Built-in hybrid search and semantic ranking Generally available
Azure SQL Database SQL Server teams that want a native vector type Exact k-NN; DiskANN in preview 1,998 Hybrid search possible with sample code Service GA; DiskANN in preview
Azure Managed Redis Ultra-low-latency, in-memory retrieval, or teams already on Redis FLAT, HNSW 32,768 Vector plus attribute filters (text, numeric, tag, geo) Generally available

Two rules of thumb we give clients:

  • Start with the database you already run. Microsoft’s own guidance makes the same point: adding a dedicated vector service adds cost, a second copy of your data, and sync lag. If your application data is in PostgreSQL, the cheapest RAG backend is usually that same PostgreSQL database.
  • Pick Azure AI Search when the content is scattered. If your RAG corpus comes from SharePoint, Blob storage, and three line-of-business systems, a separate index with built-in connectors is often worth its cost.

Azure HorizonDB is interesting because it removes the reasons teams usually give for adding Azure AI Search on top of PostgreSQL: hybrid search, reranking, and ingestion.

Azure vector database comparison: HorizonDB, PostgreSQL, Cosmos DB, AI Search, SQL Database, Redis

What is Azure HorizonDB?

Azure HorizonDB is Microsoft’s cloud-native, fully managed, PostgreSQL-compatible database service, built for high-throughput and AI workloads. Microsoft announced it at Ignite in November 2025 and opened the public preview at Microsoft Build on June 2, 2026. You can find out more about it here.

Under the hood, HorizonDB separates compute from storage. A cluster has one read-write primary and one or more readable replicas, and all of them share a single copy of the data in zone-resilient storage. Compute nodes write only the write-ahead log (WAL); the storage layer rebuilds data pages from it. In practice, that means:

  • Scale: up to 192 vCores per node and 3,072 vCores across the primary and replicas, with databases up to 128 TB
  • Read scale-out: up to 15 readable replicas, which are quick to add because they don’t need their own copy of the data
  • Faster failover: no WAL rewind or reinitialization of the old primary after a failover
  • PostgreSQL compatibility: your existing drivers, SQL, and extensions such as pgvector keep working

For RAG, the database engine matters less than what Microsoft built on top of it.

Why Azure HorizonDB is a strong fit for RAG

1. No separate vector database

Vector search runs natively next to your relational data. Your embeddings, your source records, and your metadata live in the same tables, under the same transactions, backups, and access controls. There’s no second system to keep in sync, which is the most common source of stale answers we see in RAG projects.

2. A choice of vector indexes

HorizonDB supports an exact (flat) scan plus three approximate nearest-neighbor indexes: IVFFlat, HNSW, and DiskANN. Microsoft recommends DiskANN as the default for production AI workloads. Combined with HorizonDB’s spherical quantization, it keeps search fast at scale while cutting memory and storage overhead.

3. Hybrid search in one query

Pure vector search misses exact terms: product codes, policy numbers, people’s names. HorizonDB combines pgvector similarity with BM25 full-text ranking through the pg_textsearch extension, so one query can match both meaning and keywords.

4. Filtered retrieval that keeps its recall

This is the feature that matters most for enterprise RAG. Most vector indexes filter after the search: they find the 20 nearest chunks, then throw away the ones the user isn’t allowed to see, and sometimes nothing is left. DiskANN advanced filtering (public preview since June 2026) pushes the metadata predicates into the index itself, so it keeps searching until it has enough rows that pass your WHERE clause. Microsoft’s initial benchmarks show up to 3x lower query latency, depending on how selective the filter is.

If you’re building multi-tenant RAG, or RAG where answers depend on the user’s permissions, this is the reason to look at HorizonDB.

5. Reranking inside SQL

The azure_ai.rank() function adds a reranking stage without leaving the database. It rescores your top candidates with a cross-encoder model (Cohere-rerank-v4.0-fast by default, deployed through Microsoft Foundry). Reranking is one of the cheapest ways to improve answer quality, and here it’s one function call.

6. Graph RAG without a graph database

Some questions depend on relationships, not similarity: which cases cite this ruling, which suppliers feed this part. HorizonDB can run the full graph-augmented RAG pipeline inside the database: vector search, semantic reranking, graph traversal with Apache AGE and Cypher, and Reciprocal Rank Fusion. On Microsoft’s U.S. case-law benchmark (500,000 cases), recall rose from 40% with vector search alone to 70% with citation traversal added.

7. Ingestion and data cleaning in the database

AI pipelines (public preview) let you declare multistep workflows such as chunk → embed → index in SQL. They run next to your data, with retries and checkpointing, and they react to data changes, so embeddings stay in sync with your source tables without a separate ETL job.

Two AI functions help with data quality. azure_ai.is_true() evaluates whether a statement is true, which is useful for filtering noisy or off-topic content. azure_ai.extract() pulls structured fields and entities out of unstructured text, which gives you metadata to filter on.

8. Infrastructure that suits read-heavy workloads

Most RAG workloads read far more than they write. Shared storage makes readable replicas cheap to add, and model charges from Microsoft Foundry appear on your HorizonDB invoice under “AI model management,” with no extra HorizonDB fee for managing models. You can also mirror transactional data to Microsoft Fabric OneLake, which is useful for analyzing retrieval quality over your usage logs.

Not sure which Azure vector database fits your RAG project? We help mid-market teams choose and architect the right data layer before they commit. Talk to a Data-Sleek database architect.

How to build a RAG application on Azure HorizonDB

Here’s the build sequence we’d follow for a production-minded prototype.

Step 1: Set up the database

Enable the extensions you need. A typical RAG setup uses vector (pgvector), pg_diskann, pg_textsearch, and azure_ai; add age if you plan to do graph retrieval. Then register your embedding, chat, and reranking models. AI Model Management (limited preview) offers one-select provisioning and registers default aliases: default-embedding (text-embedding-3-small), default-chat, and default-reranker (Cohere-rerank-v4.0-fast). You can also bring your own Foundry models.

Step 2: Prepare and store the data

Clean, chunk, embed, and enrich your source content. Store metadata as columns in the chunk table, or in a JSONB field next to the vector, so you can filter with ordinary SQL: tenant, document ID, date, permissions. Then build two indexes: a vector index (DiskANN for large or filtered workloads, HNSW for smaller ones) and a full-text index for keyword search.

Step 3: Automate ingestion (optional)

Define an AI pipeline with ai.create_pipeline(...) (chunk → embed → index) and execute it with ai.run(...). Let it re-embed as rows change so the index stays current without a separate ETL job.

Step 4: Retrieve

  • Vector search: embed the question with azure_openai.create_embeddings() and order results by cosine distance (<=>).
  • Hybrid search: combine vector similarity with BM25 keyword ranking in one query.
  • Filtered search: add WHERE clauses on your metadata. DiskANN advanced filtering keeps these fast.

Step 5: Refine

Rerank the top-N candidates with azure_ai.rank(). Optionally drop irrelevant chunks with azure_ai.is_true(). For questions that depend on relationships, add graph traversal and merge the result lists with Reciprocal Rank Fusion.

Step 6: Generate

In the application layer (our recommendation for production): pass the retrieved chunks to an LLM through LangChain, Semantic Kernel, or the Azure OpenAI SDK. You get streaming, tracing, and the freedom to swap models.

In the database: azure_ai.generate() can produce the answer straight from SQL. That’s fine for batch jobs and simple use cases.

RAG pipeline on Azure HorizonDB with hybrid search, filtering and reranking

A minimal retrieval query

This query retrieves 20 candidates for one tenant, reranks them, and returns the top five chunks for your application to send to the LLM:

-- 1. Embed the question once
WITH q AS MATERIALIZED (
  SELECT azure_openai.create_embeddings(
           'default-embedding',
           'How do we handle late shipments?')::vector AS v
),
-- 2. Retrieve candidates for one tenant
candidates AS (
  SELECT c.id, c.chunk_text
  FROM chunks c
  WHERE c.tenant_id = 42
  ORDER BY c.embedding <=> (SELECT v FROM q)
  LIMIT 20
)
-- 3. Rerank and keep the top 5
SELECT cand.id, cand.chunk_text, r.rank
FROM azure_ai.rank(
       'How do we handle late shipments?',
       ARRAY(SELECT chunk_text FROM candidates ORDER BY id),
       ARRAY(SELECT id FROM candidates ORDER BY id)
     ) AS r
JOIN candidates cand ON cand.id = r.id
ORDER BY r.rank
LIMIT 5;
-- 4. Send these 5 chunks to the LLM from your application

The table and column names (chunks, tenant_id, chunk_text) are placeholders. Check function signatures against the HorizonDB AI functions documentation, since preview APIs can change.

A lesson from our own RAG build: notice that the query embeds the question once, in its own CTE, rather than inside the ORDER BY. When we built CIP, our internal Client Intelligence Platform (a RAG application on SingleStore), the vector search step took 9 to 11 seconds per question. The index wasn’t the problem. The query embedding was being converted for each of roughly 52,000 rows. Binding it once brought the search step down to 0.22 to 0.34 seconds. Whatever database you use, check the query plan with EXPLAIN ANALYZE and make sure your query vector is computed once and the vector index is actually used.

Four RAG patterns you can run on HorizonDB

Pattern Retrieval flow Best for
Basic RAG Vector search → LLM Prototypes, small and clean corpora
Production RAG Hybrid search + metadata filters → rerank → LLM with citations Most enterprise knowledge assistants
Graph RAG Vector search + rerank + graph traversal → fusion → LLM Citations, multi-hop questions, entity relationships
Agentic RAG An agent (Foundry, LangGraph, Semantic Kernel) calls HorizonDB as a tool, often through an MCP server, and picks the retrieval strategy for each question Mixed question types, assistants that also take actions

Most of our clients need the second pattern. Start there, measure, and add graph retrieval only when you can show that relationship questions are failing.

What are the trade-offs of Azure HorizonDB?

Maturity and cost

  • It’s a preview. Public previews carry no service level agreement and aren’t intended for production workloads. The documented preview limitations include no customer-managed keys, no cross-region read replicas, backup retention fixed at 7 days, no built-in connection pooling (PgBouncer), and no virtual network injection (Private Link is supported). For regulated industries, a missing customer-managed key option alone can stop the project.
  • Limited regions. HorizonDB runs in a limited set of Azure regions during preview. Confirm yours before you plan anything.
  • Provisioned compute, not serverless. You pay per provisioned vCore for the primary and the high-availability replicas, plus storage per GiB-month. Small or bursty prototypes pay for idle time. At the time of writing, we couldn’t confirm published per-vCore preview rates, so model the cost with Microsoft before you commit.
  • A young ecosystem. There are far fewer community examples than for pgvector on Aurora, AlloyDB, Supabase, or Neon. Benchmarks such as the graph RAG recall gain and the 3x filtering speedup are Microsoft’s own numbers.

Architecture

  • One writer. A single read-write primary handles all writes. Bulk ingestion, or re-embedding a large corpus after you change embedding models, competes with live queries on that one node. Schedule it.
  • Scaling up causes downtime. Changing the compute size restarts the server: the database is briefly unavailable and existing connections drop. Plan scale-ups for maintenance windows.
  • Model calls inside the database. When your SQL calls a model, model latency and rate limits become database latency, and long-running calls tie up connections. That’s another reason to keep the generation step in the application layer.
  • A scale ceiling for vector-only workloads. At billions of vectors or very high query rates on vector search alone, a dedicated vector database may still perform better.

Lock-in and flexibility

  • Tied to Azure models. The azure_ai embedding and reranking functions steer you toward Azure OpenAI and Microsoft Foundry models. Bring-your-own-model is supported, but the defaults point to Foundry. Plain pgvector code stays portable.
  • Harder to debug and swap parts. Pipelines written as SQL functions are harder to trace, A/B test, or swap than application code in LangChain or LlamaIndex. Decide up front which logic lives in the database and which lives in your app.

When should you use Azure HorizonDB for RAG?

HorizonDB is a good fit when your RAG workload is:

  • Read-heavy, with many more questions than document updates
  • Azure-native, with your applications and identity already in Azure and Microsoft Entra ID
  • Built on relational data that users need to query alongside documents
  • Dependent on access control: per-tenant isolation or permission-based filtering

It’s a poor fit when you are:

  • Building a cost-sensitive prototype that sits idle most of the day
  • Running an ingestion-heavy workload with constant bulk writes or frequent re-embedding
  • Committed to a provider-agnostic stack. Self-managed PostgreSQL with pgvector, Supabase, or Neon gives you most of the same retrieval setup without the lock-in.
  • Going to production in the next few months and need an SLA. Use Azure Database for PostgreSQL with pgvector and pg_diskann today, and keep your retrieval code portable.

How to evaluate HorizonDB before you commit

Don’t choose an Azure vector database from a feature table, including ours. Before committing, we run this short evaluation with clients:

  1. Benchmark your own corpus. Compare pgvector HNSW against DiskANN with advanced filtering, using your real filters (tenant, permissions, dates). Measure recall@k against an exact flat scan, plus p95 latency.
  2. Test the selective filters. The gap between post-filtering and in-index filtering is largest when a filter matches only a small share of rows. That’s exactly the multi-tenant case.
  3. Confirm your region and compliance needs. Check region availability, customer-managed keys, network isolation, and backup retention against your security requirements.
  4. Model the cost. Include the primary, HA replicas, storage, and Foundry model usage at your expected query volume.
  5. Plan the exit. Keep the core retrieval in standard pgvector SQL, so you can run on Azure Database for PostgreSQL now and move to HorizonDB, or away from it, later.

This is the kind of decision our database consulting and AI/ML consulting teams make with clients every week. The pattern we see most often is the one we describe in why AI projects fail in mid-market companies: the model gets the attention, while the data layer underneath decides whether the answers are any good. If you’re still deciding on the engine itself, start with our guide on how to choose the right database for your application.

Choose your Azure vector database with an architect, not a feature list

Azure HorizonDB is the most ambitious attempt yet to put the whole RAG retrieval stack inside a PostgreSQL database, and for read-heavy, permission-sensitive enterprise RAG, it’s worth evaluating now. Just evaluate it as what it is today: a preview. Benchmark it on your own data, keep your retrieval code portable, and keep production on a service with an SLA until Microsoft ships general availability.

Data-Sleek’s database architects design PostgreSQL, MySQL, SQL Server, SingleStore, and ClickHouse systems for mid-market companies, and we build RAG applications on them ourselves. If you want a second opinion on your RAG data layer, book a free consultation with a Data-Sleek data expert.

Get a Second Opinion on Your RAG Data Layer

Data-Sleek’s database architects design PostgreSQL, MySQL, SQL Server, SingleStore, and ClickHouse systems for mid-market companies, and we build RAG applications on them ourselves.


Research by Riya Verma, AI Engineer at Data-Sleek. Written by Franck Leveneur, founder and CEO of Data-Sleek. Facts last verified against Microsoft documentation on November 23, 2026. Azure HorizonDB is in preview, and features, limits, and function signatures may change.

Sources

Frequently asked questions

What is the best vector database on Azure?

There’s no single best option. For RAG on relational data with filtering and reranking, Azure HorizonDB is the most complete option, but it’s in preview. For production today, Azure Database for PostgreSQL with pgvector and pg_diskann is the safest PostgreSQL choice. Use Azure AI Search when your content comes from many sources, Azure Cosmos DB for NoSQL when your app already runs on Cosmos DB, and Azure Managed Redis when latency matters most.

Is Azure HorizonDB production ready?

Not yet. Azure HorizonDB entered public preview on June 2, 2026. Previews carry no SLA, and several enterprise features, such as customer-managed keys and cross-region replicas, aren’t available yet. Use it for prototypes and evaluations, and plan production on a generally available service until Microsoft announces general availability.

What is the difference between Azure HorizonDB and Azure Database for PostgreSQL?

Both are managed PostgreSQL services. Azure Database for PostgreSQL is the generally available service with pgvector and pg_diskann support. Azure HorizonDB is a new cloud-native architecture that separates compute from shared storage, scales to 3,072 vCores and 128 TB, and adds HorizonDB-specific AI features: DiskANN advanced filtering, AI pipelines, and AI Model Management.

Is Azure AI Search a vector database?

Azure AI Search supports vector search, hybrid search, and semantic ranking, so it can serve as the vector store for RAG. It’s a separate search index rather than a database for your application data, so it adds a second copy of your content and some lag between source updates and the index.

Is Azure Cosmos DB a vector database?

Azure Cosmos DB for NoSQL includes integrated vector search with flat, quantizedFlat, and DiskANN indexes, plus hybrid search that combines BM25 and vector results. It’s a good choice when your operational data already lives in Cosmos DB.

What is DiskANN?

DiskANN is Microsoft’s approximate nearest-neighbor search algorithm. It finds similar vectors quickly by walking a graph instead of scanning every vector, and it keeps high recall at very large scale. It’s available in Azure HorizonDB, Azure Database for PostgreSQL (pg_diskann), Azure Cosmos DB, Azure DocumentDB, and, in preview, Azure SQL Database.