upsert
A database write that inserts a row if it does not exist and updates it if it does, in one statement.
In more detail
Because repeating the same upsert leaves the same result, it is naturally idempotent. It removes the need to check whether a row exists before writing.
Example
PostgreSQL: INSERT ... ON CONFLICT (event_id) DO UPDATE ...Related terms
- idempotency — The property of an operation that gives the same result whether you run it once or many times, because a repeat run finds nothing left to do.
- idempotent consumer — A message or webhook handler that produces the same result whether it sees a message once or several times.
- PostgreSQL — A widely used open source relational database server with strict typing, rich data types and extensions.
Taught in
- Blank Names After Every Deploy — Confluent Apache Kafka Certifications (CCDAK and CCAAK) Exam Prep
- Idempotent Consumers And Deduplication Keys — Apache Kafka & Event Streaming