skip to content

data pipeline and data quality · lesson 1 of 9 · sources checked 2026-11-22

the record model: events, history, and absence

This lesson shows how to store observations as events, keep an append-only history, and store a value that nobody measured as null.

status of this lesson: documented in my test system

purpose

A total in a table looks like a fact, but it hides how it came to be. When a pipeline keeps only totals, it cannot answer a new question or correct an old error. The record model decides what the store can still prove a year later.

objectives

  1. Design a record model with an event table, a history table, and a null rule.
  2. Explain why a table of totals is a cache that you can rebuild, and not a source.
  3. Store a return to an old value as a new dated row.
  4. Keep the data of two metric definitions apart in each chart.

new terms

event row
A row that records one observation at one time and that the system never changes.
rolling aggregate
A row that holds the totals of event rows and that the system can rebuild from them.
append-only history
A table that gets a new dated row for each change and never updates an old row.

how it works

A record model has three parts and one rule:

partwhat it holds
Event tableOne row for each observation
History tableOne dated row for each change of a value
Metric definition logA version and a change date for each metric
Null ruleA value that nobody measured is null, never 0

events are the source of truth

An event row records one observation at one time. The system never changes it. For example, one row holds the time, the page, the tool version, and the observed value.

A rolling aggregate holds totals of event rows, for example 7 passes in 9 trials for one tool. It is a cache with a loss, because it cannot say when a pass occurred or which tool version made it.

When the event rows exist, the system can rebuild the totals at any time. When only the totals exist, the old detail is gone. Thus a chart reads the event table and computes the totals when it reads. A new question, for example the pass rate of one tool version, then gets its answer with no new capture.

one table of counters and its guards

On the benchmark platform, my test system, one table of counters needed a set of guards:

  • a step that computed the difference from the last total;
  • a dedupe of the same total;
  • a check for a counter that went back to zero;
  • a check that the passes are not more than the trials.

The cure was to store events and to compute the totals at read time. Now each attempt writes one event row. The row holds the proxy class, the tool version, and the observed value. A result with no value stays null in each chart.

history is append-only

An append-only history gets a new dated row for each change. It never updates an old row. Thus a value that goes back to an old state still gets a new row.

For example, a page shows the block state A, then B, then A again. The history holds three dated rows. A unique rule on the value would refuse the third row, and the return to A would be lost. Thus the table has no unique rule on the value.

A history that appends a row for each observation, also with no change, fills with copies. The first chart in the section "Data" shows this fault in one history table. The correction is to compare the new value with the last row of the same key, and to append only on a change.

an absent value is null

An absent value is a value that the system did not measure. The store keeps it as null, and a chart never shows it as 0.

For example, a tool with 0 trials has no pass rate. If the derived rate is 0, the tool sorts at the same place as a tool that lost each trial. Thus each derived figure is null when its trial count is 0.

A declared value is not a measured value. For example, the page of a tool can declare a feature, and a test can measure it. The two values go into two columns, and the store never merges them.

a metric definition has a version

A column name can stay the same while its meaning changes. For example, a latency column can change from "time until the page settles" to "time until the response arrives". The two values differ by a large factor, and a chart that pools them shows a false drop.

Thus the system keeps a log of metric definitions. Each metric has a version and a change date. A chart never pools data across a change. Parts of a system can change on different days, so the log keeps a date for each part.

why a defender stores events too

A site can also keep a log of events. With such a log, a defender can measure how a client changes over time. For example, a site can compare the requests of one address in this week with the requests of the last week. A counter hides that change.

the two sides

automation sidedetection side
The collector keeps one event row for each attempt, with the proxy class, the tool version, and the observed value. A null result stays null in each chart.The defender also stores events. A log of events lets the defender measure how a client changes over time. A counter hides that change.

design decisions

optiongaincostwhen it is correct
Store counters onlySmall tables, fast readsNo detail, no rebuild, and many guards against bad totalsNever as the only store
Store events, and compute totals at read timeEach new question has its data, and a fault in a total is easy to correctMore rows, and each read does more workEach observation that a chart or an audit can use
Keep a rolling aggregate beside the eventsFast reads of the common totalsThe cache can drift from the eventsWhen reads are slow, and a job rebuilds the cache from the events
Append a history row for each observationA simple writerThe table fills with copiesNever
Append a history row only on a changeOne row for each real change, also a return to an old valueThe writer must read the last row firstEach history table
Store an absent value as 0Simple sumsA missing value looks like a measured failureNever
Store an absent value as nullEach chart can show "no value"Each query must handle nullEach derived figure with a count of 0

diagram

the record model of a pipeline

  1. Event tableOne row for each observation. The source of truth. No row changes.pass
  2. History tableA new dated row for each change of a value, also a return to an old value.pass
  3. Metric definition logA version and a change date for each metric. A chart never pools across a change.pass
  4. Rolling aggregateTotals of event rows. A cache that the system can rebuild. Not a source.no result
  5. Null ruleA value that the system did not measure is null, never 0.pass

Each chart reads events or history, and shows null as no valuepass

The event table is the source of truth. A rolling aggregate is only a cache that the system can rebuild.source: My model of the record model of a pipeline

data

rows of one history table that repeat the previous capture of the same key

status of this figure: measured by me

rows of one history table that repeat the previous capture of the same keyrows that repeat the lastcapture121804rows that differ from thelast capture4961unit: rows

source: Benchmark platform, data (my test system): one history table, stored rows; date 2026-11-03; sample of 126,765; condition: A row repeats when it equals the previous capture of the same key. The old table held development data with known defects.

data table
rows of one history table that repeat the previous capture of the same key
row classrows
rows that repeat the last capture121804
rows that differ from the last capture4961
The writer appended a row on each observation. 96.1% of 126,765 rows repeat the previous capture (96.0 to 96.2). The table has 66 keys. In an old table of development data with known defects, 21 of 41 rows were exact copies.

The first chart shows stored data of the benchmark platform. Most rows of the history table repeat the last capture of the same key. Only the other rows record a change. A writer that appends only on a change keeps those rows and none of the copies.

median latency of a browser attempt under two metric definitions

status of this figure: measured by me

median latency of a browser attempt under two metric definitionssettle time (34544 s)median latency11.7unit: sresponse time (28325 s)median latency0.57unit: s

source: Benchmark platform, data (my test system): latency of a browser attempt, two metric definitions; date 2026-11-03; sample of 34,544; condition: Settle time: n = 34,544. Response time: n = 28,325. The chart n is that of the first panel.

data table
median latency of a browser attempt under two metric definitions
seriesmetric definitions
settle timemedian latency11.7
response timemedian latency0.57
The metric changed from settle time to response time. Parts of the system changed on different days. The two medians are not for the same attempts, thus the bars show no trend.

The second chart shows one latency column under its two definitions. The settle time median is much larger than the response time median. A chart that pools the two shows a fall in latency that did not occur.

failure modes

problemcausecorrection
A total goes down, or the passes are more than the trials.The system stores counters, and a reset or a double write changed a total.Store event rows, and compute the totals at read time.
A new question has no data and must wait for a new capture.The store kept only totals, thus the detail is gone.Keep the event table as the source of truth.
A return to an old value is not in the history.A unique rule on the value refused the new row.Remove the unique rule on the value. Append a dated row for each change.
Most rows of a history table are copies.The writer appends a row for each observation.Append a row only when the value differs from the last row of the same key.
A tool with no trials sorts with the tools that lost each trial.The derived rate is 0 when the trial count is 0.Set each derived figure to null when its count is 0.
A chart shows a sudden fall in latency.The chart pools data across a change of the metric definition.Keep a version for each metric, and split each chart at the change date.

check questions

  1. Which table is the source of truth in the record model of a pipeline?

    1. The table of rolling totals
    2. The event table, with one row for each observation
    3. The dashboard cache
    4. The table of the newest value of each key
    answer

    b. The event table, with one row for each observation

    Each event row records one observation, and the system never changes it. The totals are a cache that the system can rebuild from the event rows.

  2. Explain why a table of totals is a cache and not a source.

    sample answer

    A total cannot say when each pass occurred or which tool version made it. The system can rebuild each total from the event rows at any time. When only the totals exist, the detail is gone, and a reset or a double write can change a total with no record.

  3. A page shows the block state A, then B, then A again. How many rows does an append-only history hold for these values?

    1. One row, because A and B are the only values
    2. Two rows, because A occurs two times
    3. Three dated rows
    4. No row, because the last value equals the first value
    answer

    c. Three dated rows

    An append-only history gets a new dated row for each change. The return to A is a change, thus it gets its own row. The table has no unique rule on the value.

  4. A tool has 0 trials. What is its pass rate in the store?

    1. Null
    2. 0%
    3. 100%
    4. The mean rate of all tools
    answer

    a. Null

    The system did not measure the rate, thus it is an absent value. A 0 would sort the tool with the tools that lost each trial.

  5. A latency column changes from settle time to response time. Describe how you keep the chart correct.

    sample answer

    Keep a log of metric definitions with a version and a change date for each metric. Split the chart at the change date, and never pool the values of the two definitions. Keep a date for each part of the system, because the parts can change on different days.

exercise

exercise Do this task on paper. The data is synthetic. It holds six observations of one page by one tool:

no.timeblock statetrialspasses
110:00A11
211:00A11
312:00B10
413:00B10
514:00A11
615:00not measured00

A second tool has no observation of this page.

  1. Write the event rows of the six observations.
  2. Write the history rows of the block state. Append a row only on a change.
  3. Compute the pass rate of the first tool from the event rows.
  4. Write the pass rate of the second tool.
  5. Write the value that row 6 gives to the block state.
sample answer

The answer uses the event rule, the history rule, and the null rule of "How it works".

The event table has six rows, one for each observation. The history has three rows: A at 10:00, B at 12:00, and A at 14:00. The rows at 11:00 and 13:00 are copies, thus they are not in the history. The return to A at 14:00 gets its own row.

The first tool has 5 trials and 3 passes, thus its pass rate is 3 of 5, or 60%. Row 6 has 0 trials, thus it adds nothing to the rate. The second tool has 0 trials, thus its pass rate is null, not 0. Row 6 gives the block state null, and the history gets no new row.

sources

  1. My model of the record model of a pipeline, 2026-11 (not public).
  2. Benchmark platform, design (my test system): the event rows, the history rule, and the null rule, 2026-11 (not public).