All Questions
Vector Search medium

Product records live in PostgreSQL. The application writes to Postgres and then to the vector index in the same request handler. Occasionally the second write fails, and search returns deleted or stale products. What is the most robust design?

  1. A Make the vector database the system of record and have Postgres sync from it, so writes only ever land in one place.
  2. B Wrap both writes in a distributed two-phase commit so the Postgres row and the vector always commit atomically together.
  3. C Treat the index as derived: stream changes via an outbox or CDC and apply them with an idempotent, retrying indexer.
  4. D Retry the vector write in the request handler up to three times and log failures, which covers transient errors in practice.

One system design question a day, with spaced repetition so the ones you miss come back.

Get the app

Related questions