
A vector database supports similarity search over numerical representations of data. A relational database organizes records into tables with defined relationships and supports operations such as filtering, joins, constraints, and transactions. These capabilities can coexist: choosing vector search does not automatically mean replacing your relational database.
The practical decision is where search should run and who will maintain the data it depends on. You might keep exact lookup and text search in an existing database, add vector capabilities there, or operate a separate retrieval service. Choose by the queries, update requirements, access rules, and operating work the application needs.
This guide uses a fictional support-document catalog to compare those options. It is a documented architecture comparison, not a database benchmark or a tested installation tutorial.
A user who supplies a document ID expects the matching record. A user who asks for current setup instructions for a particular product needs filters and relevant search results. Someone describing an unfamiliar error in their own words may benefit from similarity search.
These requests should not all be forced through the same retrieval method. Exact identifiers and eligibility conditions belong in explicit comparisons and filters. For terms and phrases in document content, test a text-search baseline. PostgreSQL's full-text search documentation describes matching natural-language documents and ranking them by relevance.
Vector search compares embeddings using a distance or similarity measure. Its usefulness depends on the representation, the data, and the query. A nearby vector is not proof that a document answers the question, is current, or is authorized for the user.
| Application request | Starting approach | Acceptance check |
|---|---|---|
| Open document D-104 | Exact lookup with access checks | The correct permitted record is returned |
| Find published guides for product A | Structured filters, optionally with text search | Every result matches the product and publication rules |
| Find a guide for a problem described in different words | Compare text, vector, and possibly hybrid retrieval | Judged-relevant documents appear in useful positions |
| Summarize a permitted guide with an LLM | Authorized retrieval followed by generation | The answer is supported by the selected source |
The pgvector project adds vector similarity search to PostgreSQL, alongside its relational capabilities. A separate vector engine is another option. For example, Qdrant supports conditions on record IDs and metadata. It would be inaccurate to describe vector databases as unable to filter structured fields.
| Option | Reason to evaluate it | Operational question |
|---|---|---|
| Existing relational search | Exact lookup, filters, and text search already satisfy the task | Can the baseline meet relevance and response-time targets? |
| Relational database with vector capabilities | Search needs vectors close to authoritative records and relational operations | Can search, writes, and maintenance share resources acceptably? |
| Separate vector retrieval service | Retrieval needs a different operating boundary or engine-specific capabilities | Who maintains synchronization, permissions, recovery, and another service? |
Keeping data together can reduce the number of systems to coordinate, but does not make embedding generation instantaneous or resource usage free. Separating retrieval can allow independent capacity planning, while adding another failure path and data lifecycle. Neither arrangement has a universal record-count threshold or automatic cost advantage.
Imagine a company with product guides stored as source documents and a relational catalog containing document IDs, versions, owners, publication status, and access groups. Users need to find instructions without seeing material outside their permissions.
First, test the existing catalog's exact and text-search routes against representative questions. If they meet the requirements, keeping them is a valid outcome. Add complexity only when you can identify the missing capability or operating constraint.
If similarity search improves the task, decide whether embeddings belong beside the catalog records or in a separate service. For each indexed chunk, retain a stable identifier, source document and revision, text or source reference, embedding model version, and the metadata needed for filtering. Keep the authoritative document record identifiable in either design.
A query embedding must be compatible with the stored document embeddings. Matching dimensions alone does not establish compatibility between models or versions. Plan model changes as versioned index changes, with evaluation and rollback, rather than silently mixing representations.
For this catalog, the comparison should include product filters, restricted documents, withdrawn versions, and recently updated instructions. A test containing only unrestricted, unchanged content would miss the difficult operating requirements.
Suppose an administrator withdraws a guide while a background process is still indexing its previous revision. Define which state wins and how a late indexing result is rejected. A source revision or generation marker can make stale writes detectable; the application still has to enforce that rule.
With a separate retrieval service, record source changes durably and make their delivery retryable. Track synchronization lag, failed events, and the latest applied revision. Reconcile the source catalog and retrieval inventory periodically so that a missed update does not remain invisible.
Deletion requires the same attention. Decide when a withdrawn document becomes ineligible for results and how its vectors, cached content, and derived files are removed under the retention policy. A successful deletion in one database is not evidence that every copy disappeared.
A single database can simplify some of this coordination, but an asynchronous embedding worker can still fall behind. Make indexing state visible and specify whether queries should exclude, fall back from, or explicitly identify records whose search representation is not current.
Similarity does not grant access. Derive the user's permitted scope from trusted identity and policy data, and apply it throughout retrieval and generation. A tenant ID supplied by an untrusted client is not sufficient authorization.
Test using the application role and credentials that will run in production. Database features only help when the application uses them correctly. Our PostgreSQL row-level security guide covers role and policy testing for that approach.
When permission data is copied into a separate index, define how changes take effect and how requests behave during synchronization delays. Do not send unauthorized content to an LLM or external processor and try to remove it from the final answer afterward.
Filtering also changes the search task. Measure relevance and result counts within realistic authorized subsets. Removing disallowed results from an already truncated candidate list may leave too few useful documents. The selected engine's filtering and search behavior needs to be evaluated together.
Use a fixed document snapshot and a labeled set of representative queries. Include exact IDs, paraphrases, ambiguous questions, no-answer cases, restrictive filters, and permission changes. Keep a held-out set for evaluation rather than tuning every setting against the same examples.
Approximate nearest-neighbor search trades some retrieval recall for speed. Compare it with exact vector search when measuring that tradeoff, as described in the pgvector documentation. Exact nearest neighbors are a mathematical reference; they are not automatically the documents a human considers relevant.
Measure both retrieval relevance against judgments and response time under expected concurrency. Include writes, embedding updates, index maintenance, and backup activity in the workload. A fast isolated query says little about how the service behaves during a busy update cycle. The RAG performance guide covers retrieval and answer-quality evaluation in a larger pipeline.
Test recovery as part of the decision. If the retrieval store can be rebuilt, record how long rebuilding takes and how users are served meanwhile. Preserve source revisions, model and preprocessing versions, and index configuration needed for recovery. A backup that restores records without a usable search path may not meet the application's recovery target.
Budget database compute, memory, index and source storage, embedding generation, transfers, replicas where required, backups, monitoring, and staff time. Include the cost of re-embedding changed content and the capacity needed during rebuilds. Different products package these items differently.
Separate routine database serving from model execution. A vector-search requirement does not by itself prove that the database needs a GPU; embedding generation and other model workloads have their own hardware choices. Measure the actual configuration rather than buying from the category name.
Compare options at the same relevance, latency, freshness, and recovery targets. For the hosting responsibility decision, see our PostgreSQL hosting guide. A managed database and a customer-operated VM require different budgets for maintenance and incident response.
Compute with Hivenet provides infrastructure to evaluate for customer-operated data services and model workloads. Confirm software compatibility, capacity, storage needs, and operating responsibilities before choosing a configuration.
The RAG with Hivenet page distinguishes managed model inference from a self-managed application and retrieval stack. Using a managed inference endpoint does not make your vector database or permission system managed. Guided project scope should be agreed explicitly; this article does not claim a managed Hivenet PostgreSQL or vector-database service.
To discuss a retrieval workload, bring:
These details turn a broad database comparison into a testable decision about data placement, service responsibilities, and whether a separate retrieval system earns its complexity.
Pick one AI, compute, or storage workload and see the difference for yourself. Spin it up in minutes, or let our team map your fastest path to production.