Compare Data History and Snapshot Strategies
A practical enterprise data modeling pattern or illustrative case study.
A current-state table answers what is believed now. An append-only change log records changes or events and supports replay or audit when complete and retained. A log may require reconstruction logic to answer current state and should define corrections and ordering.
Current state and change log
A current-state table answers what is believed now. An append-only change log records changes or events and supports replay or audit when complete and retained. A log may require reconstruction logic to answer current state and should define corrections and ordering.
Effective-dated history
Effective-dated records describe when a fact applies in the business domain. A separate record-time history may capture when the system learned or corrected the fact. Use both timelines when users need to distinguish those questions.
Periodic and accumulating snapshots
A periodic snapshot captures state or measures at a regular interval. An accumulating snapshot tracks milestones in a process with a predictable lifecycle. Transaction fact tables capture individual events. Kimball describes these fact patterns; see Kimball transaction fact tables and Kimball accumulating snapshot fact tables.
Choose based on use
List as-of questions, correction needs, volume, retention, latency and query patterns. A combined approach may be appropriate, but identify the authoritative record for each use and test reconciliation across representations.
Apply the pattern
Confirm business meaning, workload, ownership and constraints with the people responsible for the system and its consumers. Use representative test cases and record assumptions, exceptions and change responsibilities.
Start with the questions history must answer
Ask whether consumers need the current value, the value valid at an event time, or what the system knew at a previous point. A customer address may be overwritten for a current contact view, versioned to analyze deliveries by address-at-order, or tracked with transaction time to explain what a prior report showed. These questions require different evidence.
Compare history patterns
| Pattern | Useful for | Trade-off |
|---|---|---|
| Overwrite current state | Simple current-state use where prior values do not matter | Past state is lost unless another source retains it |
| Effective-dated versions | Reconstructing values valid during an interval | Requires interval and late-correction rules |
| Append-only events | Explaining transitions and replaying state | Consumers need projections and correction semantics |
| Periodic snapshots | Regular point-in-time balances or status | Can be large and may miss changes between snapshots |
| Transaction-time history | Reconstructing what the system knew when | More complex temporal queries and storage |
Define correction and restatement behavior
A correction can change the truth about the past or only the system's knowledge. Decide whether prior reports are restated, versioned or preserved as published. Record rule versions and source timestamps needed to reproduce decisions. Test backdated updates, overlapping intervals, late events and deleted records.
History should be proportional to the use case and approved policy. Retaining every field forever is not automatically safer or more useful. Define ownership and retention for historical records with authorized policy owners.
- Which historical question must be answered?
- Are valid time and recorded time distinct?
- Can corrections be traced to source and actor?
- Are snapshots aligned to a defined cutoff?
- Are restatement and retention rules approved?
Worked example: compare history designs
For an account status, a current-state row answers what is true now, an effective-dated record answers what was valid on a business date, and a periodic snapshot answers what the measured population looked like at a scheduled cutoff. An event history can explain each change but may require projection logic. Decide which queries must be supported before comparing storage options.
Consider correction semantics, record-time reconstruction, deletion, volume, query complexity, and consumer skill. A snapshot is straightforward for point-in-time reporting but may miss intraday changes. Effective intervals are compact but require non-overlap rules. Event logs preserve transitions but need reliable ordering and replay behavior.
Validate the selected pattern
Write example queries for current, prior-valid, and prior-known state. Test late corrections, retractions, gaps, and open intervals. Document which representation is authoritative and how derived views are rebuilt. Avoid combining patterns without explaining precedence.
Compare cost and query behavior
Estimate storage and processing for events, effective intervals, and periodic snapshots using expected change rate and retention. Write the required as-of and trend queries and measure their complexity. Consider whether consumers can reliably interpret the history representation without specialized support.
Test correction, deletion, and backfill against each candidate. Include lifecycle and privacy obligations in the comparison. Choose the design that answers required questions with an operable cost and clearly document what it cannot reconstruct.
Document history semantics for consumers
Explain how to query current, valid-at-time, recorded-at-time, and snapshot values. State restatement behavior and interval boundaries. Provide examples and warn about invalid aggregations across snapshots.
Keep documentation aligned with implementation and version changes. Gather feedback when consumers struggle to reconstruct state.