liveBook · Manning

Append-only system

As explained in Snowflake Data Engineering

An append-only strategy is a data-loading technique that adds new records without updating or deleting existing records.

An append-only system preserves change history by inserting a new row whenever data changes rather than updating or deleting an existing row. In an incremental pipeline, this avoids repeatedly reloading all data and moves less data than full ingestion, reducing processing time, storage, and compute consumption. section 12.0 section 12.5

For historical records, store the entity identifier, changed attributes, and a validity-start timestamp. Unlike classic SCD type 2, no validity-end timestamp is stored or updated. The end of a row’s interval is derived from the next row’s start timestamp; the final row is current and receives a far-future end date when queried. section 12.2.1 section 12.2.2

Use the pattern as a simpler alternative to update-based history tracking:

  • Insert an initial version with its validity-start timestamp. section 12.2.2
  • Insert another version when an attribute changes, retaining the prior version unchanged. section 12.2.2
  • Partition records by entity and order them by validity start to derive each validity end from the following row. section 12.2.2
  • Expose the derived interval through a view, or materialize it when better query performance is needed. section 12.2.2

Deriving partner validity periods

A partner rated B from 1 June 2023 receives a new row rated A on 8 August 2023. `LEAD(valid_from) OVER (PARTITION BY partner_id ORDER BY valid_from)` yields 8 August as the B row’s end; `NVL` replaces the A row’s missing next date with `9999-12-31`. section 12.2.2

Table 12.4 Sample data in the PARTNER table with the append-only strategy
Partner ID
Partner name
Rating
Valid from
103
Crave Coffee
B
1.6.2023
103
Crave Coffee
A
8.8.2023

Compare the two retained PARTNER versions: each change creates a row with a new `Valid from` value and leaves the earlier row intact. section 12.2.2

How Snowflake Data Engineering covers it

How deep it goes
Works through row insertion and derives validity ends with LEAD and NVL, while deferring the illustrative query from exercises.
Examples
Uses PARTNER rows where a rating changes from B to A between June 1 and August 8, 2023.
What you can do after
Apply it via Snowflake SQL to retain versions and calculate validity intervals for downstream consumers.
How it connects
Connects incremental ingestion with SCD type 2, SQL window functions, views, and idempotent pipelines.

Also explained in

Compare how 2 books explain append-only system →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Snowflake Data Engineering. The section links point to the parts of the book it draws on.