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

Netflix logs the facts and regenerates the features

There's a route between recomputing everything and logging everything.

Log the facts, regenerate the featuresInteractive
services = facts, at request time. The facts are logged as they come.

Netflix took the third route. It logs the raw inputs the serving path fetched, which it calls facts, such as viewing history and My List. Then it regenerates the features offline with the same encoder code.

Its fact store post describes the flow. After the recommendations are generated, the applications log the facts with a fact logging client. Later, an offline feature generator uses the logged facts to regenerate temporally accurate features. Temporal accuracy, as the post defines it, is being able to regenerate the exact features that were generated for the recommendations. The post says regeneration takes hours, where feature logging takes weeks.

That keeps both guarantees. The inputs are what the services returned at request time, so there's no time skew. The encoders are shared, so there's no code skew. And a new encoder over existing facts can be tested on past weeks right away.

In the editor, write log_facts(at, plays) and regenerate(record, encoder). The stub gives you one encoder, plays_7d, which counts the plays in the 168 hours up to at, and history gains a play after the record is logged.