liveBook · Manning

Time-based cache

As explained in Distributed Machine Learning Patterns

A cache whose validity or freshness is determined by the elapsed time since the stored data was last updated.

A time-based cache prevents repeated data ingestion when a regularly updated dataset is still fresh enough for the next machine-learning workflow run. section 5.4.2 section 7.5.2

Implement the freshness check by storing:

  • the location of the ingested and cleaned dataset, such as a remote database location; section 5.4.2
  • the dataset's last-updated timestamp; and section 7.5.2
  • a freshness window that determines whether the workflow skips ingestion or re-ingests the data. section 5.4.2

Two-week freshness window

When a workflow is triggered, it reads the cached timestamp. If the dataset was updated within the past two weeks, training uses the stored dataset directly; otherwise, the workflow reconstructs and executes data ingestion. section 5.4.2 section 7.5.2

Figure 5.22 The workflow has been triggered, and we check whether the data has been updated within the last two weeks by accessing the cache. If the data is fresh, we skip the execution of the unnecessary data ingestion step and execute the model training step directly.
05-22

The workflow diagram traces the cache lookup, freshness decision, skipped ingestion step, and direct transition to model training. section 5.4.2

How Distributed Machine Learning Patterns covers it

How deep it goes
Defines cached fields, freshness-window evaluation, dynamic workflow construction, and the skip-or-reingest decision.
Examples
Uses a regularly updated dataset, a remote database location, and a two-week freshness window.
What it assumes
Assumes a scheduled dataset, an ingestion step, a training workflow, and access to the stored dataset location.
What you can do after
Operate/configure workflows that reuse fresh ingested datasets and re-ingest only after the freshness window expires.
How it connects
Connects cache freshness with data ingestion, machine-learning workflows, remote datasets, and model training.

This explainer was generated by Manning's knowledge graph from the text of Distributed Machine Learning Patterns. The section links point to the parts of the book it draws on.