Module 8 of 16

Freshness, Contracts, and Documentation

Make data understandable, current, and safe to change.

Updated

95 minutes1 exercisesFree

Start here

Learning objectives

  • Explain source freshness and data SLAs
  • Document models and columns clearly
  • Understand model contracts and ownership
Freshness, Contracts, and Documentation Follow the arrows. Each box is one idea you will practice in this module. Freshness step 1 Contract step 2 Docs step 3 Owner step 4 SLA step 5 Production analytics engineering turns raw records into governed, trusted business meaning.

The Mental Model

A trusted model needs more than correct SQL. Users need to know what it means, who owns it, how fresh it is, and what changes are allowed.

Documentation is the instruction label on the data. Freshness is the expiration date. A contract is the promise that the shape will not change silently.

Dataset reference: ecommerce tables and grain assumptions.

Separate valid data from fresh data

At 09:00 UTC, the newest source ingestion timestamp is 08:10. A daily model can pass every key test while still violating a 30-minute freshness objective.

ContractExample valueFailure action
OwnerPayments data teamRoute alerts to the accountable team
Loaded timestampingested_at in UTCInvestigate missing or invalid timestamps
Maximum source age30 minutes during the agreed service windowWarn consumers that the source is delayed
Serving model ageLatest successful model runCheck transformation lag separately

Expected finding: source age is 50 minutes, exceeding the example objective by 20 minutes. Use ingestion time when measuring delivery delay; an old event can arrive on time in a backfill. Document maintenance windows and empty-source behavior so an alert has an actionable meaning.

Interactive Check

Question: A payments source stops updating at midnight but tests still pass. What kind of check is missing?

Reveal the answer

A freshness check is missing. The data can be structurally valid but stale.

Practice: Write the Model Contract Card

Document one model with grain, owner, freshness expectation, and important columns.

Use the guided lab below to record your result, assumptions, and the check that would catch an incorrect result.

Production notes

Keep these close

  • A model without an owner has no one accountable when it breaks. Ownership is part of the data product.

Common mistakes

What usually breaks

  • Writing descriptions that repeat the column name
  • Ignoring freshness until executives report stale dashboards
  • Changing column meaning without updating docs

Key terms

Vocabulary used in this module

Freshness

How recently a source or model has received expected data.

Contract

A declared promise about model columns, types, and shape.

Exercises

Practice inside the lesson

30-45 minutesBeginner to Intermediate

Write the Model Contract Card

Document one model with grain, owner, freshness expectation, and important columns.

  1. Write the model description starting with "One row per..."
  2. Add owner and domain
  3. Add a freshness expectation for the source
  4. Mark columns that should not change type without review

Expected evidence

A short answer, SQL/YAML snippet, or lineage map that can live directly in the course page notes.

Recap

Key takeaways

  • Freshness is a quality dimension
  • Documentation prevents repeated tribal explanations
  • Contracts make downstream breakage less likely

Related resources

Keep learning across CodersSecret