18/35
Part 2 of 3 · Two stores, one truthLearn and do

Log what you served, or recompute it later

There are three ways to build training rows, and they differ in what they risk.

Three ways to build training rows

Recompute from the warehouseLog the served featuresLog the facts, regenerate
Try a new feature on past weeksright awayonly from the day it shipsright away, over facts already logged
Code skewpossible: a second implementationnonenone: the encoders are shared
Time skewpossible: wrong timestamps, late events, missing defaultsnonenone: the facts are what serving fetched
The catchskew, unless every join is rightweeks of waiting, and log volumestoring the facts, and no fact you never logged

The three differ in how fast you can try a new feature, and in how much skew they let in.

Recomputing from the warehouse is the fastest to try. Run the feature definitions over historical tables with point-in-time joins. You can try a new feature over a year of history this afternoon.

The risk is every way a mismatch slips in:

  • a second implementation
  • a join on the wrong timestamp
  • late events that the warehouse has and the stream never saw
  • the timeouts and defaults that happened online and never show up offline.

In the editor, write history_days(route, shipped_days_ago, facts_days, warehouse_days, new_fact). It puts the table's first row in numbers: how many past days a new feature can train on under each route.