Temporal & Versioned Graphs

A static graph tells you what is true; a temporal graph tells you what wastrue, when it changed, and who said so. You'll model both valid-time (when a fact holds in the real world) and transaction-time (when the system learned it), version nodes and edges without losing history, run “as of” time-travel queries, and carry the provenance that auditors and regulators demand — weighing it all against the cheaper but lossier alternative of periodic snapshots.

Day 2 Progress0%

Why Static Graphs Lie

The graphs you built earlier in this track answer one question well: what is true right now? Alice WORKS_FOR Acme. Acme ACQUIRED Beta. A product BELONGS_TO a category. But almost every real domain is a moving target, and a graph that only stores the present quietly throws history away every time you run an UPDATE or DELETE.

The Mutation That Erases the Past

Consider the most innocent-looking write:

Alice changed jobs. Update her WORKS_FOR edge from Acme to Globex.

In a naive property graph you delete the old edge and create a new one. The graph is now correct — for today. But you have destroyed a fact: that Alice worked for Acme from 2019 to 2024. Any question about the past is now unanswerable. "Who worked at Acme in 2022?" "What did our org chart look like before the reorg?" The data simply isn't there anymore.

This is not a corner case. It's the default behavior of mutable storage, and it bites hardest exactly where it matters most: finance, healthcare, compliance, fraud, and any system that has to explain a decision after the fact.

Two Different Clocks

The key insight that organizes this whole topic: there are two independent time axes, and confusing them is the most common modeling mistake.

  • Valid time (also called application time): when a fact is true in the real world. Alice's employment at Acme has a valid time of 2019-01-01 to 2024-03-15. This is about the domain, not the database.
  • Transaction time (also called system time): when the database knew the fact. Maybe HR didn't enter Alice's resignation until 2024-04-01 — two weeks after it actually happened. The transaction time differs from the valid time.

A graph that tracks both axes is called bitemporal. It can answer not just "what was true on date X?" but "what did we believe was true on date X, as of what we knew on date Y?" — the question every audit and every "why did the model approve this loan?" investigation eventually asks.

What You'll Build This Day

By the end you'll be able to:

  • Attach valid-time and transaction-time intervals to nodes and edges
  • Version entities so updates append rather than overwrite
  • Write "as of" time-travel queries that reconstruct the graph at any past instant
  • Carry provenance (source, author, confidence) alongside temporal facts for audit
  • Choose deliberately between full bitemporal modeling and cheaper periodic snapshots
Key Takeaways
  • Naive UPDATE/DELETE silently destroys history — the moment matters most in regulated and audited domains
  • Valid time = when a fact is true in the real world; transaction time = when the database learned it; tracking both is 'bitemporal'
  • Temporal modeling closes intervals instead of deleting facts, so the entire history stays queryable

AI Learning Assistant

Powered by advanced LLM

Get personalized help with concepts, code examples, and explanations tailored to your learning pace.

Course Stats

Estimated Time
50 min
Lessons
5 sections