A registry is useful when feature definitions are executable contracts with owners, inputs and compatibility rules.
Feature definitions: versioned views, ownership and lineage
Version the computation
Changing a 47-hour failure count from event-time windows to ingestion-time windows changes the feature even if its name stays the same. Assign a semantic version or new feature name, record the transform code and input contract, and identify models that consume it. Model lineage must resolve the exact feature definition used for training and inference.
Document freshness and type
Store entity type, value type, units, allowed nulls, expected range, update cadence and maximum serving age. A count below zero is invalid; an old count may be valid data but unsafe for a live decision. Define whether a feature is batch-computed, stream-updated or request-time. A registry entry should make those retrieval modes obvious to callers.
Review access and lifecycle
A learner-level feature can contain sensitive behavior. Apply access policy at the feature view and underlying store, retain only what the use case requires, and delete or invalidate values under the relevant policy. Deprecating a view requires finding dependent models and migration dates; deleting the old definition before a historical model can be reproduced breaks auditability.
Rehearse an incompatible change
Version one count excludes retried receipt events; version two accidentally includes them. Run both against the same fixture and show the mismatch before migration. A model trained on version one should not silently receive version two online. The release packet should include owner approval, parity test and a rollback path to the previous materialization.
Implementation
def validate_count_feature(record, max_age_minutes, now_minute):
if record["value"] is None or record["value"] < 0:
return False
return 0 <= now_minute - record["materialized_minute"] <= max_age_minutesPerformance and operating cost
Validation is O(1) per record and O(N) for N records. Registry lookups can be cached, but cache entries must include the definition version; otherwise a deployment can mix a new transform with old validation limits.
Common Mistakes
- Do not reuse a feature name after changing its meaning.
- Do not treat a registry as an access-control substitute.
- Do not delete historical definitions needed to reproduce a released model.
