Do you really need a vector database? This guide gives a practical, no-hype way to decide. You will get a simple decision tree, a quick TCO model, and safe architecture patterns. We keep two tracks: Manager Mode for decisions, Builder Mode for implementation patterns.
Quick Summary
- If your corpus is small, stable, and fits in memory, a simple file or SQL store with embeddings is often enough.
- Choose a vector DB when you need low-latency similarity at scale, frequent updates, metadata filtering, and multi-tenant isolation.
- Start hybrid search early: keyword + vector + rerank for better precision.
- Measure with eval sets before and after switching. Accuracy beats architecture fashion.
Manager Mode – decision-first guide
Use this section to decide when a vector DB is justified and how to communicate the tradeoffs.
Do-you-need-it decision tree
- Corpus size – under 50k docs and rarely updated: start with a lightweight approach.
- Freshness – do you add or change documents hourly: lean toward a vector DB with fast upserts.
- Latency – interactive UX needs sub-200 ms retrieval at P95: a vector DB can help.
- Filters – heavy use of metadata filters and multi-tenant isolation: vector DB with filtered ANN.
- Budget – if TCO is sensitive, prototype with SQLite or Postgres + embeddings first.
- Accuracy – if hybrid search and reranking fix most misses, postpone the DB switch.
The table below gives a compact baseline for when a vector DB becomes cost-effective. Adjust numbers to your reality.
| Signal | Lightweight store OK | Vector DB likely needed |
|---|---|---|
| Corpus size | ≤ 50k chunks, ≤ 1 GB embeddings | ≥ 200k chunks, multi-GB embeddings |
| Update frequency | Daily batch adds | Continuous upserts or deletes |
| Latency target | P95 ≤ 500 ms acceptable | P95 ≤ 150-250 ms required |
| Filters | Few metadata filters | Complex filters, multi-tenant scopes |
| Traffic | ≤ 10 QPS peaks | ≥ 50-100 QPS sustained |
Fast TCO model
Plug in your numbers to estimate monthly cost. This simple model compares a lightweight store vs a managed vector DB.
| Cost item | Lightweight store | Vector DB | Notes |
|---|---|---|---|
| Storage | Low | Medium – High | Embeddings can be large per vector |
| Compute | Low, CPU only | Medium, index build and ANN queries | Index maintenance costs |
| Engineering | Low | Medium | Ops, monitoring, migrations |
| Accuracy gain | Small if hybrid already used | Medium when filters + scale matter | Evaluate on your test set |
Success metrics
- Answer accuracy – judged by an eval set with ground truth.
- Latency P95 – user perceives responsiveness at the 95th percentile.
- Freshness SLA – time from document publish to searchable.
- Cost per 1k queries – include storage, compute, and ops time.
Builder Mode – patterns, schemas, guardrails
This appendix shows how to implement a safe retrieval layer. Copy the parts that fit your stack.
Start lightweight – recommended baseline
- Store chunks and embeddings in a simple DB table or files with a small index.
- Add metadata columns for tenant, access level, doc type, and updated_at.
- Implement hybrid search: BM25 keyword + vector top-k, then rerank top candidates.
- Cache results for hot queries. Evict on doc changes.
Here is a compact table schema to keep things predictable across stores.
table chunks ( id text primary key, doc_id text, tenant_id text, access_level text, -- public|internal|restricted content text, embedding vector, -- or blob if not native vector type tokens int, doc_type text, created_at timestamp, updated_at timestamp, metadata jsonb -- tags, language, author, etc. );
When moving to a vector DB – essential features
- Filtered ANN queries – combine vector similarity with metadata filters like tenant_id and access_level.
- Fast upserts – partial index builds or HNSW insert speed matters when docs stream in.
- Multi-tenant isolation – guardrails to prevent data leakage across customers.
- Backup and restore – snapshot embeddings and metadata together.
- Observability – query logs, latency histograms, drift detection on embeddings.
Hybrid search pattern – reliable default
Use this three-stage retrieval pattern. It is easy to evaluate and improves precision without overfitting to a single method.
- Stage 1 – keyword: BM25 or full-text to fetch top N candidates with strict tenant filters.
- Stage 2 – vector: ANN search on embeddings, also filtered by tenant and access.
- Stage 3 – rerank: cross-encoder or small reranker model on the merged candidate set.
function retrieve(query, tenant_id):
kw = keyword_search(query, filters={tenant_id})
vec = vector_search(encode(query), filters={tenant_id})
cand = dedupe(kw + vec)[:100]
ranked = rerank(query, cand)
return top_k(ranked, k=10)
Chunking and embedding hygiene
- Chunk size 400-800 tokens with overlap 10-15 percent. Keep sections intact where possible.
- Normalize text: strip boilerplate, remove nav, keep headings as context fields.
- Use domain-appropriate embeddings. Recompute if you change models or language mix.
- Store embedding_version to manage migrations safely.
Eval set to prevent regressions
Create a small, realistic eval set and run it before and after any architecture change.
| Metric | Target | Notes |
|---|---|---|
| Top-k hit rate | ≥ 0.85 at k=10 | Relevant passage appears in top results |
| Exact answer F1 | Baseline or higher | Judge LLM answers against ground truth |
| Latency P95 | ≤ 250 ms retrieval | End user perceived speed |
| Cost per 1k queries | Within budget | Includes storage and ops time |
Migrations without pain
- Keep old and new indexes in parallel. Switch read path behind a flag.
- Backfill embeddings with a job queue. Track progress in a table.
- Canary 5 percent of traffic. Roll back on latency or accuracy regressions.
- Snapshot before deletion. Verify restores in a staging environment.
FAQ – vector DB vs lightweight store
Can I ship without a vector DB?
Yes. Many SMEs ship reliable RAG with a file or SQL store plus hybrid search and a reranker.
What breaks first as we scale?
Latency and update speed. Frequent upserts and complex filters are the usual push to a vector DB.
Do I always need reranking?
Not always, but reranking often lifts precision meaningfully for minimal cost.
How do I avoid vendor lock-in?
Abstract retrieval behind a small interface and store portable embeddings with version tags.
What about privacy and access control?
Apply tenant and access filters at every retrieval stage and test them in your evals.
Further reading
- Cost Optimization – caching, batching, on-device options.
- RAG for Business – private knowledge bases with citations.
- Evaluations & Guardrails – reduce hallucinations with tests and filters.
Final thoughts
Start simple with hybrid search and a clean schema. Only move to a vector database when your signals require it – scale, latency, filters, or multi-tenant isolation. Measure before and after with an eval set so you upgrade for real gains, not just a new logo in the stack.
AI Tools Business is independent. We test tools hands-on and publish results with citations or screenshots where relevant.
Editorial safeguards
- Claims verified by a second reviewer before publication.
- Changes and price updates are date-stamped and appended.
- We may use affiliate links - rankings are never paid.