skip to content

In Pinecone, how do you isolate thousands of tenants — namespace or index per tenant?

level: principalimportance: should knowfreq 42%

answer

  1. Index is heavy; namespace is free
  2. Quotas and provisioning bound one option
  3. Isolation structural, not filter-dependent
  4. Cross-tenant search is the real cost
  5. Escape hatch for outlier tenants

basics

~20 s

Namespace per tenant is the default at that scale: namespaces are created implicitly on write, cost nothing to mint, and give a hard query boundary. Index per tenant is justified only when tenants need different dimensions, metrics, regions or billing separation.

solid answer

~60 s

Start from what an index actually is: the unit you create, configure and pay for, with a fixed dimension, metric and spec, and a per-project quota on how many you can have. Thousands of those is unmanageable — thousands of control-plane objects, provisioning latency on every signup, and a quota you will hit. A namespace, by contrast, appears on first upsert, costs nothing to create, and scopes every query to exactly one tenant, so isolation is structural rather than dependent on a filter being correct. The real cost of namespace-per-tenant is that no single query can span tenants: any cross-tenant admin search or global analytics becomes fan-out plus a client-side merge. Reach for a separate index only when a tenant genuinely differs in index-level configuration — a different embedding model dimension, a different metric, data residency in another region — or when contractual isolation or per-tenant billing demands it. In practice most systems end up with a small number of indexes, one per model or region, and namespaces inside each.

go deeper

for a junior

Know that a namespace is the cheap per-tenant partition and an index is the heavyweight object, and that thousands of tenants means thousands of namespaces inside a shared index.

for a middle

Explain why namespaces are cheap — implicit creation, no provisioning, no quota — and why a query being scoped to one namespace makes cross-tenant search a fan-out problem.

for a senior

Name the exceptions that force a separate index (different dimension, metric or region, contractual isolation) and route tenants through one indirection layer so an outlier can be promoted later.

for a principal

Own the second-order consequences: per-tenant cost attribution has to be instrumented yourself, namespaces isolate results but not capacity so rate limiting is your job, and tenant-size skew plus immutable index config make migration planning part of the original design.

## Framing the decision The question is really about which Pinecone object carries the tenant boundary, and there are three candidates: a separate index per tenant, a namespace per tenant inside a shared index, or a single shared pool with a tenant attribute on each record. They differ in cost, in blast radius, and in what queries become easy or hard. ## Index per tenant An index is a heavyweight object. Creating one is a control-plane operation with real provisioning latency, it has its own immutable dimension, metric and spec, and projects have quotas on how many indexes they may hold. At thousands of tenants none of that works: signup would block on provisioning, you would exceed the quota, and every configuration change or migration becomes a loop over thousands of objects with partial-failure handling. What an index per tenant does buy is total separation — separate configuration, separate capacity, separate cost attribution, and a deletion that removes the whole object. That is occasionally the right answer, but only for a handful of tenants: a small number of very large enterprise customers with contractual isolation requirements, or tenants that genuinely need a different embedding dimension, a different metric, or storage in a specific region for data-residency reasons. Those are index-level properties, so a tenant that needs one of them cannot be served by a namespace at all. ## Namespace per tenant This is the default answer at scale, and interviewers expect you to reach it quickly and then discuss its limits rather than treat it as obvious. The advantages are concrete. A namespace comes into existence on the first upsert, so onboarding a tenant is a write with no provisioning step and no quota concern. A query is scoped to exactly one namespace and cannot see another's records, so isolation does not depend on the application remembering to attach a condition — a whole class of leak bug is structurally impossible rather than merely tested for. Offboarding is a single bulk operation: `index.delete(delete_all=True, namespace="tenant-a")` removes everything that tenant ever wrote, which matters when you have deletion obligations. And because every namespace shares the index's dimension and metric, scores are comparable if you ever do need to merge across them. The disadvantages are equally concrete. There is no cross-namespace query, so anything global — an internal admin search, a corpus-wide quality evaluation, a "find this document anywhere" support tool — must fan out one call per tenant and merge client-side. At thousands of tenants that is not a query, it is a batch job. Very small namespaces also mean each tenant's search quality is bounded by their own tiny corpus, which is a product question rather than a technical one but surfaces as "why does search feel worse for new customers". And because namespaces are minted implicitly, a bug in the tenant-id derivation creates a phantom namespace instead of raising an error, which is why the namespace string should come from one central function fed by a stable internal id, never a display name. ## Shared pool with a tenant attribute Keeping all tenants in one namespace and tagging each record with its tenant makes cross-tenant search a single call, which is the one thing namespaces cannot do. The price is that isolation now depends on every query path attaching the right condition — one code path that forgets it leaks another customer's documents, which is a far worse failure than a slow admin tool. For genuinely multi-customer data this trade is usually unacceptable. Where it does belong is *within* a tenant: use the namespace for the hard customer boundary and attributes for softer slices such as document type, source or date. That hybrid is what most mature designs converge on. ## The shape that usually wins A small number of indexes — one per embedding model, plus extras only where region or metric differs — with a namespace per tenant inside each, and metadata attributes for within-tenant structure. Tenant routing lives in one function that maps an internal tenant id to (index name, namespace), so the mapping can change later without touching call sites. Cross-tenant needs are served by an offline job that fans out, not by an online query path. ## Second-order concerns a lead should raise **Cost attribution.** On a shared index, per-tenant cost is not billed to you separately; if you must charge back, you need to attribute it yourself from query and ingest volume per tenant, which means instrumenting the routing layer from day one. **Noisy neighbours.** Tenants share the index's resources. Namespaces isolate *results*, not *capacity*, so one tenant's ingest storm or query flood is still your problem, and rate limiting belongs in your own service rather than being assumed from the partition model. **Skew.** Tenant sizes in real systems follow a power law. A design that works for the median tenant of a few thousand vectors may not suit the one holding tens of millions, and promoting that outlier to its own index later is a legitimate escape hatch — which is another reason routing must be indirect. **Migration.** Because dimension, metric and spec are immutable, a model upgrade is a new index and a full re-embed for every tenant. Plan that as a per-tenant backfill with progress tracked from namespace counts, and decide up front whether tenants cut over together or individually. ## Interview signal The weak answer picks one option and stops. The strong answer names the deciding factors — control-plane weight and quotas, structural versus filter-based isolation, and whether cross-tenant search is a real requirement — reaches namespace-per-tenant as the default, names the specific exceptions that force a separate index, and volunteers the second-order concerns of attribution, skew and migration.

  • Which specific tenant requirements force a separate index rather than a namespace?
    Anything that is an index-level property. A tenant needing a different embedding dimension or a different distance metric cannot share an index, because both are fixed at creation. Data residency in another region forces a separate index too, since the region is part of the spec. Beyond that: contractual hard isolation, or a tenant so large that it deserves its own capacity and cost line. Everything else belongs in a namespace.
  • Your support team wants a search across all tenants' documents. How do you serve it?
    Not as an online query. A query targets one namespace, so a global search means one call per namespace plus a client-side merge — acceptable as an asynchronous admin job, not as an interactive endpoint at thousands of tenants. If cross-tenant search becomes a first-class product feature, that is a signal to maintain a separate shared index for it, populated alongside the tenant namespaces, rather than to abandon the isolation model.
  • How do you handle one tenant whose corpus is a hundred times larger than everyone else's?
    Promote it. Move that tenant to its own index so its data volume, query load and cost are isolated from the shared one, and so it can be sized or migrated independently. This is only cheap if tenant routing was indirect from the start — one function mapping tenant id to index name and namespace — which is the main argument for building that indirection before you need it.
  • How do you attribute cost per tenant when they all share one index?
    You instrument it yourself. A shared index gives you one bill, and describe_index_stats gives per-namespace record counts but no per-namespace query cost. Record query and ingest volume per tenant in your own routing layer, combine that with record counts for the storage share, and apportion the bill from those. Deciding this after launch is painful, so build the counters in with the routing.

saying these in an interview costs you the question

  • Provisioning an index per tenant at thousands of tenants
  • Assuming a query can span namespaces for admin search
  • Relying on a filter alone to keep customers separate
  • Deriving the namespace from a mutable display name
  • Thinking namespaces isolate capacity, not just results

context