Zenaique

Compare namespace per tenant against single shared index with tenant filter for a B2B RAG product serving 5000 customers.

Short answer·Hard·4.0 · 0·~3 min·Asked atEyPhonepePinecone·Relevant atCursorDatabricksMicrosoftTurbopuffer
Attempt it

A B2B RAG product has 5000 customer tenants ranging from 10 documents to 500k documents each. Compare the two main multi-tenancy patterns for the vector layer (namespace per tenant vs single shared index with a tenant_id filter). Cover correctness, cost, noisy neighbor risk, and the small tenant cold start problem.

Free · 2 AI evals / day
TL;DR

Namespace-per-tenant gives strong isolation but pays per tenant overhead, hurting small tenants. Shared-index-with-filter amortizes cost but hits the filter broken recall HNSW pitfall and noisy neighbor risk.

Memory aid
Sign in to see the mnemonic that makes this stick.
Easy to grasp

Imagine you run a self-storage facility, and 5000 small businesses are renting space in your search system. **Option A: a separate room per tenant.** Their stuff is totally separated; nobody can peek; you can clear out a tenant by emptying their room. But you pay rent on 5000 rooms, and many of them are nearly empty. **Option B: one giant warehouse with everyone's stuff mixed and tagged with stickers.** Cheaper rent overall, but when a small tenant asks for their stuff, you have to search through the whole warehouse looking for their sticker, and sometimes the warehouse layout makes you miss their items. **The answer in real life:** put your three biggest tenants (who fill the warehouse) in their own rooms anyway, and pool the other 4997 into the shared warehouse.

Concept explanation~2 min read

Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.

Vector-DB multi-tenancy is one of the most consequential architecture decisions in a B2B RAG product. The wrong call shows up as either a CFO complaining about per tenant cost or a customer complaining that their search returns nothing because a selective filter stranded the HNSW walk. The 2026 production answer is rarely either pure pattern; it is a layered hybrid that recognizes a 5000x dynamic range in tenant size.

Why per tenant cost economics matter

Per-index overhead is the load-bearing variable that the basic '5000 namespaces' calculation often understates. Every index has an entry point, a metadata structure, a replication tier, a backup schedule, and an observability tax. In some vendors these are amortized inside a serverless index (Pinecone serverless namespaces share underlying compute); in others they are not (each Qdrant collection is independent).

For a 10-document tenant, the per index overhead can exceed the marginal cost of the actual vectors by orders of magnitude. Multiplied by 5000 tenants, this becomes the dominant line item on the bill. Hence the long tail tenants tend toward shared infrastructure even when isolation is theoretically nicer.

Why the filter broken recall trap is real
Why heavy tailed distributions force the hybrid
2026 vendor reality and the tradeoffs each forces
Sign in to unlock the full deep dive.

Situations where this technique stops working.

Sign in to see when this approach fails.

2–4 min · Everything important, quickly.

Sign in to see the quick scan of the deep dive.
ConcernNamespace per tenantShared index + filterHybrid
IsolationStrongFilter-only (not a security boundary)Strong for whales, filter for tail
Per tenant costConstant overhead (bad for small tenants)AmortizedRight-sized per tier
Cold-startBad for tiny tenantsNon-issueSolved per tier
Noisy-neighborBounded per indexCross-tenant interferenceBounded for whales, pooled for tail
GDPR deleteDrop one collectionScan + tombstone (expensive)Drop for whales, scan-filtered for tail
HNSW recall safetyAlways goodFilter-broken-recall riskGood for whales; mitigated by filterable HNSW for tail

Real products, models, and research that use this idea.

  • Pinecone's multi-tenancy guide explicitly recommends the hybrid: namespaces for high volume tenants, shared index with tenant_id filter for the long tail.
  • Qdrant added tenant partitioned payload indexing to mitigate filter broken recall in shared collections.
Sign in to see more production examples.

What an interviewer would ask next. Try answering before peeking at the approach.

QHow does Qdrant payload indexed search mitigate filter broken recall?
A

It builds a tenant aware inverted index that the graph walk consults to prune to only tenant matching candidates before evaluating edges. The graph connectivity is effectively tenant segmented at search time.

2 more follow-ups an interviewer would ask next. Sign in to reveal them.

Red flags & common mistakes

The phrases that signal junior thinking. Click to expand.

Most common mistake

Picking 'shared index with tenant_id filter' as universally right because it sounds efficient, without noticing that HNSW with a selective metadata filter is exactly the configuration that returns fewer than K results.

Sign in to see all red flags and common mistakes.

60 second bullets to scan on the way to the call.

  • Namespace-per-tenant: isolation + easy delete, bad cost economics for tiny tenants

  • Shared index with tenant_id filter: amortized cost, filter broken recall + noisy neighbor + slow delete

Sign in to unlock the revision sheet.

Primary sources. Browse if you want the original framing.

Similar questions

Same topic, related formats. Practice these next.

4 curated
Next question
HNSW vs IVF, when…
Flashcard·Medium