Time-to-Live (TTL) Policy¶
An expiry-clock policy — instantiates Layer Decay and Expiration Management
Stamps each layer with a fixed lifetime at the moment it's created, so it self-expires when the clock runs out — no one has to decide, later, that it's too old.
The cheapest way to stop stale layers from piling up is to decide their expiry before they ever accumulate. Time-to-Live (TTL) Policy does exactly that: at the instant a layer is created it is stamped with a fixed lifetime, and when that lifetime elapses the layer automatically expires — refreshing, archiving, or becoming eligible for deletion — with no human re-evaluating it. Its defining feature is that expiry is pre-committed and self-executing: the decision to age the layer out is made once, up front, encoded as a countdown that fires on its own. Unlike a value score (which ranks layers against each other) or a capacity rule (which fires under pressure), a TTL is an absolute per-item clock — every layer carries its own deadline and honours it independently.
Example¶
A platform issues short-lived database credentials to services on demand, each stamped with a 1-hour TTL (a lease, in the language of secrets managers like HashiCorp Vault). A service requests access, gets a credential that works, and after an hour the credential simply expires — it stops working and is revoked automatically, whether or not anyone remembered it existed. No stale, forgotten credentials accumulate for an attacker to find, because none can outlive their hour. A service that still needs access just requests a fresh lease; the new credential supersedes the expired one. The whole population of live credentials is self-limiting: at any moment only those issued within the last hour exist, enforced entirely by the up-front clock rather than by anyone auditing and cleaning up.
How it works¶
Its substance is the pre-stamped, self-firing clock, set at creation:
- Assign a lifetime at creation — a fixed duration (or absolute expiry time) attached to the layer as it's deposited.
- Encode the elapse of that lifetime as the expiration trigger: when now − created ≥ TTL, the layer fires its expiry action on its own.
- Choose the expiry action per class — hard-expire (gone), refresh (fetch a fresh version that supersedes the old), or mark eligible for downstream disposal.
- Optionally support renewal: a still-needed layer can extend its lease, resetting the clock, so liveness is opt-in rather than default.
Tuning parameters¶
- Lifetime length — the core dial. Short TTLs keep the live set tiny and fresh but force frequent refresh churn and can expire something mid-use; long TTLs cut churn but let staleness and exposure accumulate.
- Expiry action — hard-delete vs. refresh vs. mark-eligible. Refresh keeps a live equivalent; hard-expire maximises hygiene but risks a gap if the refresh isn't ready.
- Renewal policy — whether and how a lease can be extended. Renewable TTLs adapt to genuine long-lived need; non-renewable guarantee an absolute ceiling on age.
- Clock basis — measured from creation, from last access, or from last write. Last-access TTLs keep active layers alive; creation TTLs impose a hard maximum age regardless of use.
- Grace / jitter — a small buffer or randomised spread so a fleet of layers doesn't all expire at the same instant (a synchronised-expiry stampede).
When it helps, and when it misleads¶
Its strength is that it bounds accumulation automatically and per-item, deciding expiry once at the cheapest possible moment and never needing a cleanup sweep. For anything with a natural freshness horizon — credentials, caches, sessions, temporary derivations — it is the simplest possible defence against stale pileup, and shrinking exposure windows is a direct security win.
Its failure modes come from the clock being blind and absolute. A TTL set too short expires a layer that was still in use, causing a miss, a re-fetch storm, or an outage right when demand peaks; set too long, it defeats its own purpose. Because every item carries the same clock, a whole cohort created together can expire simultaneously, hammering whatever must refresh them (a thundering-herd stampede). And a fixed lifetime knows nothing about value — a TTL will cheerfully expire a rare, irreplaceable layer on the same schedule as disposable ones. The discipline is to set lifetimes to the layer's real freshness horizon, add jitter to desynchronise cohort expiry, and never point a bare TTL at layers whose loss isn't cheaply reversible.[1]
How it implements the components¶
Time-to-Live (TTL) Policy realises the pre-committed expiry side of the archetype — a per-layer clock set at birth:
expiration_trigger_definition— it defines the trigger precisely: the layer expires the moment its stamped lifetime elapses, a condition that fires without external evaluation.decay_function_or_aging_rule— the TTL is the aging rule in its sharpest form: a step function that holds a layer fully valid until the deadline, then drops it to expired.
It does not rank layers by worth or use a gradual decay curve (that's Age-Weighted Value Score), and it draws no authority from law or record class — mandated lifespans come from Retention Schedule; a TTL is a mechanical clock, not a governance rule.
Related¶
- Instantiates: Layer Decay and Expiration Management — the up-front, self-executing expiry path.
- Sibling mechanisms: Retention Schedule · Age-Weighted Value Score · Cache Eviction Rule · Lifecycle Storage Tiering Policy · Log Rotation and Cleanup Job · Stale-Layer Detection Dashboard · Dependency-Safe Delete Check · Soft-Delete Quarantine Window · Archive-Restore Test · Tombstone or Deletion Marker
Notes¶
TTL and Retention Schedule both put a clock on layers, but from opposite ends: a TTL is a mechanism that sets a short freshness lifetime at creation for operational hygiene, while a retention schedule is the authority that mandates minimum and maximum lifespans for legal and business reasons. In a well-run system the retention schedule sets the bounds and the TTL is one way of enforcing them — a TTL must never be allowed to expire a layer that a retention obligation still requires.
References¶
[1] Time-to-live is a standard, correctly-used term across networking (DNS records, IP packets), caching, and secrets management, where an issued credential's lifetime is often called a lease. It is invoked here as an established concept, not a cited source. ↩