Feature Stores
One recipe for features, cooked twice: training and live
A feature store is the shared system where features are defined once, computed, versioned and served consistently to both training and live inference — eliminating the train/serve split-personality problem.
What you will learn
- Explain the problem a feature store solves
- Distinguish offline (training) from online (serving) feature paths
- Locate feature stores in the MLOps lifecycle
What is this?
A feature store is a platform that centralizes feature definitions and values: features are defined once, computed in batch (offline) for training data and in real time (online) for inference, served through two consistent APIs. Both paths share the same source of truth and transformation logic, which is the core defense against training-serving skew.
Why do you need it?
- Teams reinvent feature code per model, then those copies drift apart.
- Live models need the same numeric value the model trained on — a mismatch quietly destroys accuracy.
- Shared, reusable features cut data-engineering duplicate to a fraction.
- Freshness is handled by design: batch for training windows, online for real-time requests.
Mental model
One kitchen baking for both a wedding hall and a food truck
A feature store's two kitchens
The banquet kitchen (offline) bakes for events ahead of time; the truck (online) heats fresh portions on demand. Same recipes, same ingredients — otherwise the truck food wouldn't taste like the tasting (training) dinner.
How it works
- Features are declared as catalog entries: name, owner, transformation logic, freshness requirement.
- Offline computation materializes historical feature values for training datasets.
- Online computation computes/retrieves the latest feature value per entity at request time.
- Both paths write to versioned stores — batch tables and a low-latency online store.
- Consumers read features via SDK: training pulls historical data, serving pulls point-in-time values.
One feature definition feeding both training and live serving.
In production
- A recommendation platform defines 'user-avg-session-duration' once and reuses it across three models.
- A fraud model trains on 90 days of features and serves from the same store's online endpoint.
- A churn team adds a feature; the store backfills historical values so retraining has coherent windows.
Best practices
- Make feature definitions code-reviewed and versioned like model code.
- Record freshness requirements per feature and enforce them in SLAs.
- Reuse features across models — the store's value grows with reuse.
- Instrument both paths with timestamps so consistency is measurable.
Common mistakes
- Adopting a store but letting teams still define features locally — the sprawl persists.
- Ignoring point-in-time correctness so training windows use future data.
- Online/offline divergences unmeasured — the store ships the disease it was meant to cure.
- No ownership metadata, so a broken core feature has nobody responsible.
Debugging tips
- Model 'fine offline, broken live' — check feature values online vs training: same recipe, same scale?
- Backfill missing? Query the feature store's history API for the window.
- Latency spike at serving? Feature lookups fanning out per request; batch the retrievals.
Interview checkpoint
Quick quiz
Which problem is a feature store specifically designed to prevent?
A feature store replaces the need for computing features at all.