buffered-upsert · research · also Upsert message

Buffered upsert

A buffered upsert encodes a deferred transformation of a key's value without first fetching that value.

Related Observatory article: Read on hesela.com

In B-epsilon trees, pending transformations must be applied in insertion order when the key is queried or the messages reach its leaf. This is not simply SQL insert-or-update syntax, and it does not by itself specify transaction isolation or durable acknowledgement. [1]

An upsert message carries the key, a callback function and auxiliary data. When it is flushed to the leaf, the stored value is replaced by the callback result and the message is discarded. A query that arrives first applies the pending messages found on the root-to-leaf path. Tombstones are a special case, and counters or access times are other examples. [1]

The primer reports nodes of about 4 MB, branching factors from 4 to 16 and batches of at least 256 KB in its implementations. Its query argument concerns I/O along the existing search path: pending callbacks do not require an extra node path. This is not a guarantee of unchanged elapsed latency; callback CPU work, message count and contention still matter. [1]

A write-optimized research file system from 2015 turns most metadata changes and partial block writes into upserts, avoiding a read-modify-write for each small write. [3]

Relations

related
B-epsilon tree, Log-structured merge-tree, LSM tombstone, Range rename, Late-binding journal, BetrFS, Write-optimized dictionary, TokuFS

Advantages

  • Makes extra secondary indexes cheap to maintain, because each index update becomes a buffered insert rather than a query. [1]

Limitations

  • The 2015 prototype's per-block deletion cost is version-specific, not an inherent requirement of every buffered index. [3]
  • The caller must be able to proceed without the computed result to retain the benefit of a blind update; returning the old value requires obtaining it. [4]

Citations

  1. Bender, Farach-Colton, Jannen, Johnson, Kuszmaul, Porter, Yuan and Zhan. An Introduction to B-epsilon-trees and Write-Optimization. ;login: 40(5), 2015. (accessed 2026-10-23)
  2. Jannen et al. BetrFS: A Right-Optimized Write-Optimized File System. FAST 2015, pp. 301-315, sections 2-4. (accessed 2026-10-22)
  3. BetrFS authors. Frequently Asked Questions, upserts and blind writes; historical prototype guidance, not a current-release specification. (accessed 2026-10-23)

Further reading

  1. Hesela. B-epsilon trees: visible updates, deferred work (accessed 2026-10-16)
Sources & caveats
  • primer is Bender et al., ;login: October 2015. Basic operations and upserts, pp. 22-26, rechecked on 2026-10-23.
  • betrfs is Jannen et al., FAST 2015, read in sections 2 to 4.
  • The node and batch figures are historical implementation descriptions in primer. Its query-performance argument concerns I/O; no new elapsed-time benchmark or speedup estimate is supplied.

JSON: /data/terms/buffered-upsert.json

Published by Hesela team · Updated

Report a correction · Editorial standards · Reuse guidance

Cite this page
Hesela team. Buffered upsert. Hesela. 2026-12-01. https://hesela.dev/terms/buffered-upsert/