Skip to content
1 min read · 129 words

Type Alias: VectorConsistency ​

ts
type VectorConsistency = "strong" | "best-effort" | "eventual";

Defined in: src/batteries/vector/types.ts:77

Read-after-write guarantee a write (.upsert() / .delete()) provides. 'strong' — the write Promise does not resolve until the change is confirmed visible to subsequent reads. On timeout it THROWS E_VECTOR_STORE_CONSISTENCY_TIMEOUT — never resolves unconfirmed. 'best-effort' — poll up to the bound, then resolve whether or not visibility was confirmed. The ONLY mode that may proceed unconfirmed, and only because the caller asked for it. NOTE: on an eventually-consistent backend a write-after-write race (e.g. deleting a just-upserted id from a concurrent writer) may not take effect — this mode does not detect it. Use 'strong' if you delete records you may have just written. 'eventual' — resolve on durable acknowledgement, with no visibility wait. Fastest; inherits the same write-after-write race as 'best-effort', silently.