Upsert
An upsert is a data-modification operation that updates a matching record or resource, or inserts it when no match exists.
Architecting an Apache Iceberg Lakehouse
An upsert operation inserts records that are absent and updates records that already exist according to a matching key or condition.
- How it is used
- Supports transactional ingestion, reconciliation, slowly changing dimensions, late-arriving data, and downstream synchronization.
- How deep it goes
- Explains matching, snapshot commits, engine responsibilities, and operational tradeoffs without detailing the Iceberg specification.
- Examples
- Uses a Spark MERGE between a staging table and target, matching records by identifier before updating or inserting.
- What you can do after
- Apply it via Apache Spark to reconcile staging data with Iceberg tables through conditional updates and inserts.
Read how Architecting an Apache Iceberg Lakehouse explains upsert →
ScyllaDB in Action
An upsert is a write operation that combines insert and update behavior by creating missing data or modifying existing data.
- How it is used
- Combines ScyllaDB inserts and updates into fast writes for restaurant-review rows.
- How deep it goes
- Explains syntax, partition-key filtering, preserved columns, and deferred deeper treatment of row liveness.
- Examples
- Uses an Ernie’s Eats fried-chicken review, UPDATE and INSERT statements, and a SELECT result.
- What you can do after
- Apply upserts with CQL UPDATE statements while preserving unchanged columns and targeting the partition key.
Akka in Action, Second Edition
An upsert is a database operation that inserts a record when no matching record exists and updates the matching record otherwise.
- How it is used
- Stores projected aggregates in a separate database while decoupling journal reads from writes.
- How deep it goes
- Defines insert-versus-update behavior and demonstrates transactional SQL, stopping short of database-library details.
- Examples
- Uses a cargo-per-container projection that creates a count and increments it for later CargoAdded events.
- What you can do after
- Apply it via ScalikeJDBC to create or update aggregate rows inside a projection transaction.
Related concepts
- database updateimplemented by · A database update is an operation that modifies existing records, rows, documents, or other stored data according to specified criteria.
- ON CONFLICT clauseimplemented by · An ON CONFLICT clause specifies the action an SQL insert takes when it violates a uniqueness or exclusion constraint.
- Documentproduces · A discrete representation of information, such as content or a structured record, optionally accompanied by metadata.
- updateOne()configures · updateOne() is a MongoDB update method that modifies the first document matching a filter, or inserts a document when upsert is enabled and no match exists.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.


