[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"glossary-upsert::en":3,"gloss-cluster-upsert::en":26,"gloss-next-upsert::en":9},{"slug":4,"category":5,"name":6,"definition":7,"meta_desc":8,"faq":9,"schema_markup":9,"related":10},"upsert","data-infra","Upsert","An upsert writes a row if it does not exist and updates it if it does, in one statement. Databases expose it under different spellings — INSERT ... ON CONFLICT, MERGE, INSERT ... ON DUPLICATE KEY UPDATE — but the purpose is the same: make a write idempotent with respect to a key, so that repeating it produces the same end state rather than a duplicate row or an error. That property is why upserts are the backbone of data pipelines and integrations. A sync that re-reads a source, a webhook consumer that may receive the same event twice, a batch job that is retried after a partial failure — all of these are safe if the write is keyed and idempotent, and all of them produce duplicates if it is not. The same reasoning applies to a nightly load that overlaps the previous window on purpose, which is the standard way to tolerate late-arriving records. Two details decide whether an upsert behaves. It needs a real uniqueness constraint on the conflict key; without one the database has nothing to detect a conflict against, and application-level check-then-insert logic loses the race under concurrency. And the update branch has to say explicitly which columns it overwrites — blindly replacing every column will wipe fields the source does not know about, such as a locally-computed status or a value another system owns. High-volume upserts also cost more than plain inserts because of the index lookups involved, so bulk loads sometimes stage into a temporary table and merge once instead.","An upsert inserts or updates in one keyed, idempotent statement — why pipelines depend on it and how a missing constraint or a blind update breaks it.",null,[11,14,17,20,23],{"slug":12,"name":13},"change-data-capture","Change Data Capture (CDC)",{"slug":15,"name":16},"database-migration","Database Migration",{"slug":18,"name":19},"delivery-semantics","Delivery Semantics",{"slug":21,"name":22},"etl","ETL",{"slug":24,"name":25},"idempotency","Idempotency",[27,31,34,37,40,44,47,50,51,54,58,61],{"slug":28,"category":5,"name":29,"updated_at":30},"acid","ACID","2026-08-24T02:46:37+00:00",{"slug":32,"category":5,"name":33,"updated_at":30},"ann-search","ANN Search",{"slug":35,"category":5,"name":36,"updated_at":30},"backpressure","Backpressure",{"slug":38,"category":5,"name":39,"updated_at":30},"batch-processing","Batch Processing",{"slug":41,"category":5,"name":42,"updated_at":43},"bm25","BM25","2026-08-24T02:46:38+00:00",{"slug":45,"category":5,"name":46,"updated_at":30},"cache","Cache",{"slug":48,"category":5,"name":49,"updated_at":30},"cap-theorem","CAP Theorem",{"slug":12,"category":5,"name":13,"updated_at":30},{"slug":52,"category":5,"name":53,"updated_at":30},"chroma","Chroma",{"slug":55,"category":5,"name":56,"updated_at":57},"chunk-overlap","Chunk Overlap","2026-08-24T03:30:02+00:00",{"slug":59,"category":5,"name":60,"updated_at":30},"columnar-storage","Columnar Storage",{"slug":62,"category":5,"name":63,"updated_at":30},"connection-pooling","Connection Pooling"]