5.3.5 · D3MLOps & Deployment

Worked examples — Feature stores

2,213 words10 min readBack to topic

This page drills the Feature stores parent note into concrete numbers. The parent gave you the point-in-time join rule and the skew condition. Here we grind every case where those rules bite — including the weird corners where a naive engineer ships a bug.


The scenario matrix

Every cell below is a distinct thing that can go wrong (or must be handled). Each worked example is tagged with the cell it covers.

Cell Case class What varies Danger if mishandled
A Normal as-of join falls between two observations none — baseline
B Future-leak corner an observation exists after data leakage
C Exact-tie corner an observation lands exactly on off-by-one (" vs ")
D Empty-past / cold start no observation before null must be returned, not crash
E TTL expiry freshest value is older than stale feature lies to model
F Multi-entity join several users, one query wrong-key cross-contamination
G Skew (offline ≠ online) two code paths compute differently silent production degradation
H Word problem (fraud) full pipeline end-to-end integrating all rules at once
I Exam twist latest-value shortcut vs as-of reveals the classic trap

We reuse two prerequisite ideas: Data leakage (cell B) and Training-serving skew (cell G).


The picture we compute against

Figure — Feature stores

Look at the figure. The horizontal axis is time. Each mint dot is a feature observation — a moment when we recorded a value. The coral vertical line at is the label event: the instant we must make a prediction. The as-of rule says: sweep leftward from the coral line and grab the first mint dot you meet. Everything to the right of the coral line is the forbidden future.

Throughout, we use one running table for user U:

value
09:00 $100
10:30 $40
12:00 $90

Cell A — the normal as-of join


Cell B — the future-leak corner

Figure — Feature stores

Cell C — the exact-tie corner ( vs )


Cell D — empty past / cold start


Cell E — TTL expiry (stale kill)


Cell F — multi-entity join (don't cross the keys)


Cell G — the skew corner (offline ≠ online)


Cell H — real-world word problem (fraud, full pipeline)

Figure — Feature stores

Cell I — the exam twist (latest-value trap)


Recall Which cell breaks each way?

Future leak comes from forgetting ::: the filter (Cell B, Cell I) A tie at should be ::: included, because is used, not (Cell C) No past observation means the feature is ::: null / default, never fabricated (Cell D) A value older than TTL is treated as ::: unknown / expired (Cell E) Offline mean 76.67 vs online mean 65 is an example of ::: training–serving skew (Cell G)