Lakehouse vs Vector Database for RAG: Governed Retrieval
Compare lakehouse and vector database roles in RAG: filtered retrieval, permissions, index freshness, deletion handling and rebuildable source data.
Author: jackey.ye · Updated: 2026-11-25
For governed RAG, the lakehouse should own authorization, freshness truth, lineage and system-of-record semantics; the vector layer should own low-latency similarity search. Bind the two with a shared snapshot and filter contract so the index is always rebuildable. This guide compares Apache Iceberg and Apache Hudi lakehouse tables, dedicated vector databases such as Qdrant, and pgvector inside PostgreSQL across metadata filtering, freshness, SQL joins and system-of-record boundaries.
The Short Answer: Which Layer Should Own Governed Retrieval?
The lakehouse — Iceberg or Hudi tables plus a catalog such as Apache Polaris or Unity Catalog — owns the system of record, ACLs, lineage, snapshot history and freshness truth. The vector layer owns approximate nearest neighbor (ANN) indexing and low-latency top-k. Governed retrieval is a boundary problem, not a product choice: the retrieval layer must never become a second, ungoverned copy of the source of truth.
Two architectures are legitimate. First, lakehouse-resident vectors with SQL-composable search, such as Hudi's VECTOR column type and hudi_vector_search SQL functions, or ANN indexes stored in Iceberg Puffin sidecar files bound to a snapshot. Second, a dedicated vector database fed by change data capture (CDC) from the lakehouse. The decision hinges on the criteria below; latency and freshness requirement framing is developed in this lakehouse vs data warehouse comparison for Power BI.
Evaluation Criteria: How to Compare Lakehouse and Vector Database for RAG
No option wins across all criteria, so score both against the same seven dimensions before choosing. Each following section examines both options side by side on one criterion.
Metadata filtering semantics and recall — whether filters are answered before or after the ANN scan, and how recall degrades at low selectivity.
Data freshness and delete propagation — how inserts, updates, deletes and re-embeddings reach the index, and what consistency window you can prove.
SQL join capability — whether permission tables, tenant mappings and dimension attributes can be joined at query time.
Retrieval vs system-of-record boundary — whether the index is derived and rebuildable, or holds facts that exist nowhere else.
Governance and lineage coverage — whether catalog RBAC, row filters and column masks apply to retrieval automatically.
Operational burden — pipelines, sync jobs, index builds and upgrade paths your team must own.
Cost drivers — storage duplication, compute for re-embedding, and query concurrency costs.
Metadata Filtering: Filter-First vs Post-Filter Recall
Filter placement decides recall more than index choice does. For performant filtering, Qdrant recommends creating payload indexes for the fields you plan to filter on before ingesting data, and it answers nested filters from per-element indexes alone when every condition is covered by a matching index. In lakehouse-resident retrieval, filters are ordinary SQL predicates evaluated with the vector search in one query, so permission and dimension filters compose naturally.
Illustrative planning example from the pgvector README: with HNSW and the default hnsw.ef_search of 40, a filter matching 10% of rows yields about 4 matching rows on average. This is a documented example of post-filter behavior, not a benchmark of any specific deployment.
The recall trap sits on the approximate side. pgvector documents that with approximate indexes, filtering is applied after the index is scanned: if a condition matches 10% of rows, with HNSW and the default hnsw.ef_search of 40, only 4 rows match on average. Iterative index scans (0.8.0+) scan further until enough results are found or hnsw.max_scan_tuples or ivfflat.max_probes is reached.
Filter-first designs can also lose recall when the filter is highly selective and the index is partitioned poorly. Both sides need recall measured against exact search, not assumed.
Data Freshness: Updates, Deletes, CDC and Re-embedding
Freshness is where the two architectures diverge most, and where the lakehouse's snapshot model does the heavy lifting. Iceberg reads are serializable-isolation reads against a committed snapshot, and the table spec represents row-level deletes through delete manifests (v2–v3) and deletion vectors carried in v4 leaf manifests. Hudi's vector search model commits source records, metadata and embeddings together, processing new and changed records incrementally so the table is the single source of truth.
A dedicated vector database depends on an external CDC pipeline that must carry inserts, updates, deletes, schema changes, metadata filter changes and backfills — the sync-consistency problem Hudi names explicitly. Tombstones and re-embedding compound it: when the embedding model changes, every vector must be regenerated, which the lakehouse can drive as a batch job over a snapshot while a vector database needs a parallel reindex.
Balance the trade-off honestly: lakehouse-resident search may show higher query latency than a purpose-built ANN service, while a vector database may offer lower ingestion-to-query latency but a wider consistency surface. Gate late CDC and freshness SLAs the way the bronze, silver and gold promotion gates do.
SQL Joins: When Retrieval Must Sit Next to Governed Tables
Retrieval must sit next to relational data when permission tables, tenant mappings or dimension attributes have to be joined at query time rather than denormalized into vector payloads — typically when ACLs change faster than the index can be rebuilt. Lakehouse-resident retrieval wins here: the vector search is a SQL function over the same table, so joins to governed dimension and ACL tables run in one engine under one permission model. PostgreSQL row security policies show the same pattern in miniature, where a policy subquery filters rows against a users table at read time.
Dedicated vector databases require denormalizing those attributes into payloads at ingest, so an ACL change means re-indexing and can drift. SQL engines reading Iceberg metadata from a relational metastore, such as the Trino Iceberg connector, are the practical bridge. Note the boundary: if the join target lives in an operational database outside the lakehouse, neither layer is the natural home and a federated query layer is needed. Co-locating search with analytics also creates resource contention, so separate compute pools or workload isolation are required.
Retrieval vs System-of-Record Boundaries
The system of record is the lakehouse table, or the operational source it ingests from; the retrieval layer is a derived, rebuildable index. The rule: any vector store must be reconstructible from the system of record plus the embedding model version, and must never be the only place a fact, permission or deletion exists.
Governance mechanics follow the boundary. Catalog RBAC such as Polaris roles, with optional external policy decision point integration such as Open Policy Agent, applies at the table layer. So do row filters and column masks: Unity Catalog documents that time travel is not supported with table-level row filters or column masks, and that Iceberg REST or Unity REST APIs cannot access tables with row filters or column masks except through cross-engine ABAC. A retrieval design that depends on masked columns therefore needs a view or an ABAC policy rather than raw table access.
A dedicated vector database outside the catalog inherits none of this automatically. Catalog-level governance adds latency and complexity; a vector database with its own auth is simpler for a single-tenant prototype but becomes a governance gap at multi-tenant scale.
Side-by-Side Comparison Table
The table summarizes the criteria above. Cells describe documented engine behavior and design consequences, not a universal winner; validate version-specific features in your own environment.
Criterion | Lakehouse-resident retrieval (Iceberg/Hudi) | Dedicated vector database (e.g., Qdrant) |
|---|---|---|
Metadata filtering | SQL predicates evaluated with the vector search in one query; recall depends on the engine's ANN implementation | Payload indexes created before ingest; nested filters answered from indexes when every condition is covered |
Freshness and CDC | Snapshot-committed reads; delete manifests and deletion vectors; Hudi commits records and embeddings together | Depends on an external CDC pipeline covering inserts, updates, deletes, schema and filter changes |
SQL joins to governed tables | Native; ACL and dimension joins run in one engine under one permission model | Requires denormalizing attributes into payloads at ingest; ACL changes mean re-indexing |
System-of-record boundary | The table is the source of truth; the index is derived and rebuildable from a snapshot | The index is a second copy that must be kept in sync and proven rebuildable |
Governance and lineage | Catalog RBAC, row filters and column masks apply at the table layer, with documented limitations | Inherits none of the catalog controls automatically; needs its own auth model |
Latency profile | Bounded by the query engine; may exceed a purpose-built ANN service | Purpose-built for low-latency top-k serving at large scale |
Operational burden | Index build cost inside the table format; engine maturity is version-bound | Separate service plus a sync pipeline to operate and monitor |
Cost drivers | Compute for search and re-embedding; storage in one copy | Duplicated vector storage plus sync compute and serving capacity |
Best fit | Frequently changing ACLs, required SQL joins, re-embedding driven from one source | Ultra-low-latency retrieval at very large scale with a reliable CDC contract |
Balanced Limitations: What Each Option Gets Wrong
Both options carry real costs, and the right answer depends on your latency SLA, tenant model, re-embedding frequency and whether ACLs change faster than the index can be rebuilt.
A dedicated vector database means a second copy to keep in sync, ACL drift between the catalog and the payloads, re-embedding cost paid twice, governance living outside the catalog, and payload denormalization that hardens every schema change. A lakehouse-resident design faces query latency and concurrency limits versus purpose-built ANN services, index build cost inside the table format, and engine maturity: Hudi vector search and Iceberg Puffin/DiskANN indexes are recent and version-bound, and the Puffin ANN design itself reports a recall trade-off from independent sharding that its authors have not yet measured systematically. Coupling analytics and retrieval workloads on one engine adds contention risk.
Neither list is disqualifying. It is a set of questions to answer with measurements before committing.
Proof-of-Concept Checklist: Testing Freshness, Deletes and ACL Filtering
Run the checklist against both candidate architectures and record numbers, not impressions.
Prerequisites: a lakehouse table with snapshot or CDC support; a vector index, lakehouse-resident or dedicated; a test corpus with known ground-truth neighbors; an ACL or permission table; and a way to measure recall against exact search.
Establish an exact-search baseline. Run brute-force nearest neighbor over the test corpus. Expected outcome: a ground-truth top-k set per query. Failure it detects: no reference point, making every later recall claim unverifiable.
Measure filtered ANN recall at 1%, 10% and 50% selectivity. Compare each result set to the baseline. Expected outcome: recall stays within your stated bound at every selectivity. Failure it detects: post-filter starvation, where the index returns fewer rows than requested.
Inject an update and measure ingestion-to-retrieval lag. Expected outcome: the new text is retrievable within your stated freshness SLA. Failure it detects: a CDC gap or a stale embedding.
Delete a record and confirm absence within the delete SLA. Include tombstone handling. Expected outcome: the deleted chunk never appears in top-k. Failure it detects: orphaned vectors surviving in the index.
Change an ACL and re-query. Expected outcome: the next query reflects the change without a full re-index, or you have measured the re-index time. Failure it detects: ACL drift between catalog and payload.
Join a governed dimension table at query time. Expected outcome: the join respects the same permission model as direct table access. Failure it detects: a retrieval path that bypasses row filters.
Trigger a re-embedding run. Expected outcome: every vector is rebuilt from the system of record and the index is reproducible. Failure it detects: vectors that exist only in the serving layer.
-- Example configuration — validate in your target environment.
-- pgvector: compare approximate vs exact results under a selective filter
SET hnsw.iterative_scan = strict_order;
SET hnsw.max_scan_tuples = 20000;
WITH approx AS (
SELECT id
FROM chunks
WHERE tenant_id = 'acme'
ORDER BY embedding <-> :query_vector
LIMIT 10
), exact AS (
SELECT id
FROM chunks
WHERE tenant_id = 'acme'
ORDER BY embedding <-> :query_vector
LIMIT 10
)
SELECT (SELECT count(*) FROM approx a JOIN exact e USING (id))::float
/ 10 AS recall_at_10;
Who Should Choose Which
Choose lakehouse-resident retrieval when ACLs and dimension data change frequently, when SQL joins to governed tables are required at query time, when re-embedding must be driven from a single source of truth, and when your retrieval latency SLA is compatible with the lakehouse query engine.
Choose a dedicated vector database when ultra-low-latency retrieval at very large scale is the dominant requirement, when the corpus is relatively static or CDC can be made reliable, and when the team accepts a governed-copy pattern with a rebuildable index and an explicit sync contract.
Hybrid patterns are often the pragmatic middle: the lakehouse remains the system of record and owns ACL truth, while the vector database acts as a serving cache holding only pre-filtered, tenant-scoped payloads. The sync contract — what is copied, how deletes propagate, and how the cache is rebuilt — is the artifact that makes the hybrid auditable.
Verdict
For governed RAG, the lakehouse should own authorization, freshness truth, lineage and system-of-record semantics; the vector layer should own low-latency similarity search. The winning design binds them with a shared snapshot and filter contract so the index is always rebuildable and never the only home of a fact, permission or deletion.
Singdata publishes a lakehouse platform built on Apache Iceberg that keeps one governed copy of data in open formats and exposes it to SQL and agents under one permission model — worth evaluating against the criteria above, with its performance and cost figures treated, like any vendor's, as claims to reproduce in your own environment.
Frequently Asked Questions
Which layer should own authorization and freshness truth for governed RAG?
The lakehouse or system of record owns authorization, freshness truth and lineage. The vector layer owns similarity search and must be rebuildable from that source.
Does metadata filtering reduce recall in approximate nearest neighbor search?
Yes, when filtering is applied after the index scan. pgvector documents that a 10% selectivity filter with HNSW and the default hnsw.ef_search of 40 matches about 4 rows on average; iterative index scans mitigate it up to configured limits. Measure recall against exact search.
How do deletes and updates reach the embedding index?
Through the lakehouse snapshot or CDC mechanism — delete manifests, deletion vectors or incremental commits — or through an external CDC pipeline into the vector database. Tombstones and re-embedding must be handled explicitly, and the index must never be the only place a deletion exists.
When does retrieval need to sit next to relational data for SQL joins?
When permission tables, tenant mappings or dimension attributes must be joined at query time rather than denormalized into vector payloads — typically when ACLs change faster than the index can be rebuilt.
What are the main limitations of each option?
Vector database: sync consistency, ACL drift, governance outside the catalog, re-embedding cost. Lakehouse-resident: latency and concurrency versus purpose-built ANN, index build cost, engine maturity.
For a related implementation check, see the least-privilege data access checklist.