skip to content

Write and Delete Visibility

On many stores an acknowledged upsert or delete may not be searchable yet, so a deleted chunk can still come back minutes later. Interviewers ask why, and how a pipeline proves a delete landed.

on this pageshow

questions

6

Why can an acknowledged upsert be missing from a vector store's search results, yet be visible at once in a transactional database?

level: juniorimportance: must knowfreq 50%

answer

  1. accepted is not searchable
  2. log first, index later
  3. index updated inside the transaction
  4. visible versus indexed
  5. replicas apply on their own

basics

~20 s

Many vector stores acknowledge a write once it is accepted or logged, then apply it to searchable segments and replicas asynchronously. A database that updates its vector index inside the transaction makes the row searchable at commit, at least on the primary.

solid answer

~40 s

On many vector stores an acknowledgement means the write was **accepted**, often durably logged, not that a search can see it. The store folds logged writes into searchable segments and its approximate nearest-neighbour index in the background, and each replica applies them on its own clock, so for milliseconds to minutes a query can miss the write. A relational database with a vector-index extension usually updates the index **inside the transaction**, so the row is searchable on the primary as soon as the commit returns, though its read replicas still lag. The trade is write cost: index inserts in the commit path slow every write, which is exactly why stores built for bulk vector ingest defer them.

go deeper

for a junior

Recall that on many vector stores an acknowledgement means the write was accepted, not that searches can see it yet, and that the gap closes in the background.

for a middle

Explain the moments a write passes through - durable, visible, indexed - and why batched index inserts and asynchronous replicas put visibility behind the acknowledgement.

for a senior

Show you know which kind of store you run, that a transactional database still lags on its read replicas, and how a canary measures the window per replica.

for a principal

Frame the trade: updating the index in the write path buys read-after-commit at the price of write throughput, so decide which paths pay for it.

## Three moments in a write's life A write to any store that serves similarity search passes through distinct moments, and a store's **acknowledgement** can be tied to any one of them: 1. **Durable** - the write is recorded somewhere that survives a crash, usually an append-only **write-ahead log** on local disk or in object storage. 2. **Visible** - a search served by the node you reach can return it. 3. **Indexed** - it sits inside the **approximate nearest-neighbour (ANN)** structure, such as an HNSW graph or an inverted-list partition, rather than in a side buffer. On a replicated store there is a fourth: **visible on every replica**, because each replica applies the log on its own schedule. An **upsert** (insert-or-replace by ID) acknowledged at moment 1 can stay invisible to search for a while. That is a design choice, not a bug, and it is the root of every "I just wrote it, why can't I find it?" incident. ## Why many vector stores acknowledge before they apply - **ANN inserts are expensive.** Adding a vector to a graph index means a neighbour search plus edge rewiring; doing that synchronously inside every request would cap write throughput. - **Batching pays.** Collecting writes into a segment and building or merging its index in the background amortises the cost and keeps query latency steady. - **Replication is often asynchronous.** A leader or a log service accepts the write and followers replay it later; a query routed to a follower that has not replayed it misses the write. - **Disaggregated designs** that keep the log in object storage and run separate indexing workers add one more hop between "logged" and "searchable". How long the window lasts depends on the store, its configuration, the load and the apply backlog: milliseconds on a quiet node, minutes behind a bulk load that floods the apply queue for every writer. Treat any single figure as one store's, measured under one load. ## The transactional case In a relational database with a vector-index extension, the vector index is typically just another index on the table. The insert updates it inside the same transaction, so once the commit returns, a new query on the primary sees the row, and an uncommitted row stays invisible to everyone else. The price is paid elsewhere: - each write carries the index insert in its own latency, so bulk ingest is slower and is often done by loading first and building the index afterwards; - the database's **read replicas** usually replay the primary's log asynchronously, so a search sent to a replica can miss a committed row - the same lag, moved to a different place. So "visible at once" holds on the primary and for reads that go there, not on every read path the application might use. ## Visible is not the same as indexed Some stores keep recent, not-yet-indexed writes in a small buffer or unindexed segment and **scan it exactly** on every query, merging those hits with the index results. Such writes are searchable before they are indexed; the cost appears as query latency that grows with the unindexed backlog. Other stores serve only what has been applied to sealed, indexed segments, and there the gap between acknowledgement and visibility is the whole apply delay. | Store behaviour | Acknowledged when | Searchable when | Main cost | |---|---|---|---| | Index updated in the transaction | at commit | at commit on the primary; later on read replicas | slower writes and bulk loads | | Logged, then applied asynchronously | received or logged | after background apply, per replica | a visibility window | | Logged, unindexed tail scanned exactly | received or logged | almost at once on nodes that hold the tail | query latency grows with backlog | ## What this means for a design - Read an acknowledgement as **"accepted"** unless the store documents a stronger meaning for the exact call and setting you use. - Where a caller must see its own write, use the store's **wait-for-apply** or **per-request consistency** options, on the few paths that need them. - **Measure the window**: write a canary record on a schedule, poll each replica until a lookup and a search return it, and track the delay, especially during bulk loads. - Do not assume deletes are faster than inserts. On many stores a delete travels the same apply path, which is why a deleted chunk can still be returned minutes after its delete was acknowledged.

  • If a write is already durably logged, why doesn't the store simply search the log?
    Some do, by exactly scanning the recent unindexed tail and merging it with the index results. That works while the tail is small; during a bulk load every query pays a brute-force scan of a growing backlog, so stores either cap the tail, apply it to indexed segments quickly, or exclude it and accept a visibility gap.
  • How would you measure a store's visibility window in production?
    Write a canary record with a known ID and vector on a schedule, then poll each replica with an ID lookup and a search until it appears, and record the delay. Track the distribution over time and watch it during bulk loads, when the apply backlog stretches the window for every writer.

A library returns desk: the clerk takes your book and hands you a receipt at once, but nobody can find it on the shelf until a librarian reshelves the cart, and the branch libraries' catalogues catch up later still. The receipt proves the library accepted the book, not that anyone can find it.

  • An upsert acknowledgement means the vector is searchable on every replica.
  • Write lag only happens in managed vector services, never in self-run ones.
  • A database with a vector-index extension is equally fresh on its read replicas.
  • A vector missing right after its upsert must have been lost by the index.
  • Deletes take effect instantly even on stores that apply inserts asynchronously.
open as a page

A user deletes a confidential document, but its chunk still appears in assistant answers minutes later: what can cause it, and how do you tell which?

level: seniorimportance: must knowfreq 45%

basics

~20 s

The delete may still be applying, a lagging replica may still serve the chunk, the delete may have matched no stored record, or the text may come from a cache or chat history. Look up the cited chunk's ID on each replica to tell which.

open as a page

A deleted vector no longer appears in search results but stays on disk until compaction: what does that mean for a data erasure request?

level: middleimportance: should knowfreq 35%

basics

~20 s

Hidden is not erased. A tombstone stops searches returning the record, but its vector and stored text stay in segment files, and often in older versions and logs, until compaction and cleanup run; erasure is complete only after that.

open as a page

What do a vector store's wait-for-apply write flag and per-request read consistency level buy, and what do they cost?

level: middleimportance: should knowfreq 40%

basics

~20 s

A wait-for-apply flag holds the write's acknowledgement until the write is searchable, buying read-after-write for writer latency and bulk throughput. A stronger read consistency level makes a query consult more replicas or wait for them, buying freshness for latency and availability.

open as a page

How does an ingestion pipeline prove a delete landed on every replica of a vector store, rather than merely that it was acknowledged?

level: seniorimportance: should knowfreq 32%

basics

~20 s

Read it back: after the acknowledgement, check each replica with exact ID lookups and a document-filter count, poll until every one reports zero, and record when. An approximate search that no longer returns the chunk proves little on its own.

open as a page

A user uploads a file to a retrieval-augmented assistant on an eventually visible vector store and asks about it at once: how do you give them read-after-write?

level: seniorimportance: should knowfreq 38%

basics

~20 s

Scope the guarantee to that user: wait for apply on the upload's final writes before marking the file ready, carry a write position into their session's reads, or overlay their fresh chunks with an exact search, merged and deduplicated by chunk ID.

open as a page