For a multi-tenant retrieval index moving to a new embedding model, how would you set the policy for cutting tenants over one at a time and routing each tenant's queries to the matching encoder?
answer
- blast radius per tenant
- one tenant, one encoder version
- version in every cache key
- shared content needs both
- a deadline for the tail
basics
~20 sRoute every query by a per-tenant table naming its encoder and vector version, never mixing versions within a query; flip each tenant only after its completeness proof and quality check pass, keep old vectors for rollback, and set a deadline for the tail.
solid answer
~50 sStaging by tenant buys a smaller blast radius and per-tenant rollback, at the price of running two encoders and two vector copies for a while. The hard rule is that a tenant's query is embedded once with that tenant's encoder and searched only against vectors of the same version, so I keep a routing table of tenant to encoder revision, put the encoder version in every cache key, and alert when a query's version differs from the vectors it hit. The policy: internal and small tenants first, the largest and contractually sensitive ones last; a tenant flips only when its completeness proof is clean and its quality check shows no regression; its old vectors stay through a rollback window. Content shared by all tenants exists under both versions until the last one moves. And I set a hard deadline, often the old model's retirement, so the mixed period ends.
go deeper
Recall that each tenant's queries must be embedded with the same model as that tenant's stored vectors, so a staged cutover needs a per-tenant record of which model that is.
Explain the routing table, why both query encoders stay live during the mixed period, and why every cache key must carry the encoder version.
Diagnose the classic cutover bugs: a stale cached query vector, shared content left on one encoder, vectors missing filter metadata, and how a version-mismatch alert catches each.
Own the policy: staged or single flip, tenant order, the per-tenant gate, rollback window, exception rules and the deadline that stops a two-model system becoming permanent.
## The decision A multi-tenant retrieval service moving to a new embedding model can switch every tenant at one moment, or move them **one at a time** as each tenant's re-embedding is proven complete. The single global flip is simpler and is how a full shadow reindex is usually cut over (covered with index builds and shadow reindexing). The staged path costs more machinery but limits the blast radius, lets a bad result be rolled back for one tenant instead of all of them, and lets early tenants benefit before the last of forty million chunks is done. Choosing between them, and setting the rules for the staged path, is a lead's call. | | Single global flip | Staged per-tenant cutover | |---|---|---| | Blast radius of a regression | every tenant at once | the tenants already moved | | Rollback | one switch, all or nothing | per tenant | | Mixed period | none | days to weeks, two encoders live | | Extra machinery | little | routing table, versioned caches, per-tenant proofs | | Fits | few tenants, one shared corpus | many tenants, uneven size and risk | ## The routing rule that must never break One tenant's query is embedded **once, with that tenant's encoder**, and searched **only against vectors of that same version**. Old and new vectors live in different spaces, so a query vector from one model scored against vectors from the other, when the dimensions happen to match, returns plausible-looking nonsense with no error. Everything else in the design serves that rule: - **A routing table**, read on every request: tenant to encoder revision and vector version tag. - **Both query encoders available** for the whole mixed period, sized for each one's share of traffic. - **Encoder version in every cache key.** A query-embedding cache keyed by query text alone hands an old-model vector to a tenant that has just moved; result and answer caches need the version for the same reason. - **A mismatch detector.** Log the encoder version of each query beside the version of the vectors it hit, and alert on any disagreement. ## Policy a lead sets 1. **Order.** Internal and test tenants first, then small, low-risk ones, then the largest and those with contractual quality commitments, so the riskiest moves happen once the path is proven. 2. **The gate.** A tenant flips only when its completeness proof passes (no missing or mixed-version chunks, every rejection decided) and its own retrieval-quality check shows no regression; how that evaluation is designed is a separate subject. 3. **Soak and rollback window.** How long a moved tenant is watched, and how long its old-model vectors are kept so it can be flipped back without re-embedding. 4. **The deadline.** A hard date by which the long tail is moved, usually set by the retirement of the old hosted model or by what running two encoders and two copies of the vectors costs each week. 5. **Exceptions.** Whether a tenant may stay pinned to the old model, for how long, and who signs that off. ## Shared content and the mixed period Content every tenant can see, such as a common help corpus or a global policy set, cannot belong to one encoder while tenants sit on both. It has to exist under **both versions** until the last tenant moves, and each tenant searches the copy that matches its encoder. Its cost is usually small next to the main corpus, and forgetting it is a classic early-cutover bug: moved tenants search shared content with new-model queries against old-model vectors. Documents ingested during the mixed period need vectors at the version each tenant will use; keeping writes that arrive during a rebuild is covered with shadow reindexing, and the per-tenant table simply says which version a new write needs. ## What it costs, and when to stop paying - **Two copies** of the vectors for every tenant inside its rollback window. - **Two query encoders** live, possibly one hosted and one self-run. - **Operational load**: per-tenant proofs, dashboards and flips. That cost argues for a short mixed period with a firm deadline. A staged cutover that never finishes leaves a permanent two-model system, and the lead's job is as much to close the tail as to open the first tenant. When there are only a handful of tenants and one shared corpus, the honest answer may be the single flip.
- What breaks if a query-embedding cache is keyed by the query text alone during a staged embedding-model cutover?A tenant that has just moved can be handed a cached query vector from the old model and score it against new-model vectors, which can return plausible but unrelated results, often with no error. Put the encoder revision in the cache key, and in any result or answer cache, and flush or version caches at each tenant's flip.
- How do you handle content that every tenant can see while tenants sit on different encoders?Keep the shared content embedded under both versions until the last tenant moves, and have each tenant search the copy matching its encoder. It is usually small next to the main corpus, so the cost is modest; forgetting it means moved tenants query old-model vectors with new-model query vectors.
- When is a single global flip the better choice than a staged per-tenant cutover?When there are few tenants, one shared corpus, no per-tenant quality commitments, and a mixed period would cost more than the risk it removes. Then one proven switch with a rollback is simpler than a routing table and versioned caches; how that whole-index flip is run is covered with shadow reindexing.
- Route by one global flag and move every tenant when the backfill ends.
- Mixing old and new vectors in one tenant's search is fine for a short while.
- Query caches do not need the encoder version in their key.
- Delete each tenant's old vectors the moment it flips.
- Leaving slow tenants on the old model indefinitely costs nothing.