Streaming retention is not finished when old records leave the topic.

State has its own retention problem

Apache Flink State TTL lets developers configure time-to-live behavior on state descriptors. That matters because streaming applications remember things: keys, joins, deduplication windows, enrichment values, alerts, and partial aggregates.

A team can delete or expire source data and still keep derived state alive inside a running application. For governed streaming data products, retention evidence needs to include application state, not only object storage and table snapshots.

TTL belongs in the data product contract

A streaming contract should name which state exists, why it exists, how long it can live, how cleanup works, and what happens during restore. The TTL setting is one piece of that evidence. Checkpoints, savepoints, state backend behavior, and state processor workflows complete the picture.

That distinction matters for audit review. A retained state value can shape an output even after the original event is gone. Operators need to prove whether state should still influence the data product.

Core idea: retention policy that ignores streaming state is only partial retention policy.

The ODI pattern links state to lineage

Open Data Infrastructure treats pipelines as part of the data product, not invisible plumbing. Flink state needs lineage, ownership, retention policy, and recovery evidence just like tables do.

For adjacent patterns, read Flink checkpoint lineage, Flink watermarks as freshness evidence, and streaming lakehouse data contracts. State TTL is one retention signal inside a larger evidence trail.

What breaks first

Retention failures hide inside state because state feels like runtime detail. It is not. It is data with operational consequences.

  • Source events expire, but keyed state still drives downstream decisions.
  • TTL settings differ across environments without review.
  • Savepoints preserve state that a retention policy intended to remove.
  • Auditors can see table cleanup but not application state cleanup.

Questions to ask before production

Ask which state descriptors have TTL, which do not, and why. Ask how TTL interacts with checkpoints, savepoints, late data, and recovery. Ask how a reviewer can connect state retention to the data product SLA.

Streaming retention is real only when the running application can prove what it remembers.

Sources to start with

These primary sources anchor the technical claims in this guide.

If the pipeline still remembers it, the retention story is not over.