Concept · Coined by Ralf Becher

Freshness Inheritance

A cached query is exactly as fresh as the source tables it depends on — not as fresh as a TTL you guessed. One heartbeat invalidates every dependent query.

Definition

Freshness Inheritance is a cache-invalidation model in which a cached query result inherits its freshness — and therefore its staleness — from the source tables in its lineage, rather than from a fixed time-to-live (TTL).

In one sentence: a cached query is exactly as fresh as the freshest-required of its source tables — one heartbeat invalidates every query that depends on it.

The Problem with TTL Caching

The classic result cache picks a time-to-live and hopes. Both directions fail:

There is no single TTL that is right, because freshness is not a property of time — it is a property of whether the source data changed.

How Freshness Inheritance Works

Each source table emits a freshness heartbeat that advances whenever its data changes. Every cached query records the lineage of source tables it was computed from. When any table in that lineage advances its heartbeat, every cached query depending on it is invalidated automatically. The consequence:

TTL Cache vs Freshness Inheritance

Property Fixed TTL cache Freshness Inheritance
Invalidation triggerClock expirySource-table change (heartbeat)
Risk of stale resultsYes, until TTL expiresNo
Needless re-computationYes, on every expiryNo, only when sources change
Tuning requiredPer-query TTL guessworkNone — driven by lineage
Cascade on upstream changeManual / noneAutomatic to all dependents

Related OrionBelt Concepts

Frequently Asked Questions

What is Freshness Inheritance?

A cache-invalidation model in which a cached query result inherits its freshness — and therefore its staleness — from the source tables in its lineage, rather than from a fixed TTL. When a source table changes, every cached query that depends on it is invalidated automatically.

How is it different from a TTL cache?

A TTL cache guesses an expiry and hopes. Freshness Inheritance is driven by real data changes: a query stays valid as long as none of its source tables have changed, and is invalidated the moment one does.

What is a freshness heartbeat?

Each source table emits a freshness heartbeat that advances when its data changes. Any cached query whose lineage includes that table watches the heartbeat; when it advances, the query is invalidated. One upstream change cascades to every dependent query.

Who coined the term Freshness Inheritance?

Freshness Inheritance was coined by Ralf Becher (RALFORION) and is implemented in the result cache of the open-source OrionBelt Semantic Layer (OBSL).

Caching that never lies

OrionBelt Semantic Layer (OBSL) runs as a hosted demo at orionbelt.ralforion.com — results stay cached until their sources actually change.

Live Demo GitHub Contact RALFORION