Temporal and Bitemporal Data Modeling
A practical guide for enterprise data modeling and architecture.
A current-state model answers what is believed now. Effective-dated history can answer what was true during a business period. Bitemporal designs also track when the system recorded or corrected that belief. Choose based on audit, analysis and correction needs rather than storing multiple timelines by default.
Choose the time question
A current-state model answers what is believed now. Effective-dated history can answer what was true during a business period. Bitemporal designs also track when the system recorded or corrected that belief. Choose based on audit, analysis and correction needs rather than storing multiple timelines by default.
Valid time and record time
Valid time is the period a fact applies in the business domain. Record time is the period a system assertion is stored as current knowledge. If a contract is corrected later to show an earlier start date, valid time and record time differ. Define boundary conventions, time zones and open-ended periods explicitly.
Represent intervals carefully
Decide whether periods use inclusive or exclusive endpoints and how adjacent changes meet. Prevent overlapping active periods where the business rule disallows them. Handle open-ended current records consistently. Preserve the source and reason for corrections when those details matter.
Query and operate
Provide clear patterns for current state, as-of business time and as-known-at processing time. Test late corrections, same-day changes, gaps and overlap boundaries. Temporal history increases storage and query complexity; retain only the precision and duration required by business use and applicable obligations.
Apply the guidance
Validate assumptions with the accountable owner and representative consumers. Record trade-offs, examples and unresolved questions, and link the resulting decisions to the relevant model, contract or operating procedure.
Worked example: a backdated correction
A supplier relationship is entered on June 10, but a signed agreement later confirms that it became effective on June 1. Valid time starts June 1; record time begins June 10, and a later correction may have its own record-time event. A query asking “who was the supplier on June 5?” differs from “what did the system show on June 5?” The first uses valid time; the second requires knowledge history.
Choose only the time dimensions needed
Many models need only event time or effective dates. Add transaction or record time when audit, reconstruction or delayed correction questions justify the cost. Define whether history is stored as intervals, immutable events or snapshots, and state how a correction changes prior records.
Make temporal queries unambiguous
Use explicit names such as valid_from, valid_to, recorded_from and recorded_to. Choose half-open or closed interval boundaries consistently. Specify timezone and precision. Queries should identify which timeline they use rather than rely on a generic “as of” parameter.
Guard against overlapping validity intervals when only one value may be active. If multiple concurrent assertions are allowed, represent source or confidence context. Test same-day changes, open-ended periods, late arrival, backdated corrections, retractions and gaps.
Operate bitemporal history deliberately
Provide reusable query patterns and clear indexes or partitions for common time questions. Monitor invalid or overlapping intervals and record the correction source. Temporal history adds storage and query complexity; use retention approved for the data and business purpose rather than a blanket “keep everything” policy.
- Can users distinguish valid time from recorded time?
- Are interval boundaries and timezone explicit?
- Can past truth and past knowledge be queried separately?
- Are corrections and retractions auditable?
- Is temporal complexity justified by actual questions?
Worked example: what was known at a date?
A supplier record says a relationship began on March 1, but the organization receives the confirmation on March 12. Valid time begins March 1; recorded time begins March 12. If corrected again later, retain the knowledge history when audit questions require it. “What was true on March 5?” and “what did the system know on March 5?” are different queries.
Choose interval boundaries, timezone, precision, and treatment of open-ended periods. Enforce non-overlap if one value must be active at a time. For bitemporal data, define which operations close and open each valid and record interval. Preserve correction source and reason without overwriting evidence.
Test temporal query semantics
Test same-day changes, late arrival, retroactive correction, retraction, gaps, and overlapping assertions. Document reusable as-of query patterns and monitor invalid intervals. Keep transaction-time history only when the questions justify its additional storage and operational complexity.
Implement temporal history controls
Enforce interval rules, record correction source, and distinguish a business-valid change from a system entry or correction. Provide a tested as-of query and indexes that support common time questions. Monitor gaps and overlaps.
Define retention and deletion behavior for prior versions. Ensure restoration does not reactivate superseded values. Document how downstream snapshots are restated or preserved.
Validate a temporal model release
Test boundaries, retroactive correction, record-time history, timezone, and query behavior against known examples. Check interval integrity and retention. Document which timeline each consumer query uses.
Review downstream restatements and consumer guidance after release.