ML and data systems in production
Operate feature stores, model serving and data pipelines, where failures are often silent and quality matters as much as uptime.
17 min readWhy ML systems fail differently
A web service that breaks returns errors. A model that breaks keeps returning confident answers that are quietly wrong: recommendations become stale, a classifier starts letting spam through, a fraud model approves more fraud. The causes are usually in the data, not the code: an upstream schema change, a broken pipeline that fills a feature with zeros, or the world changing so training data no longer matches reality. Operating ML means monitoring quality and data, not just latency and errors.
Feature stores and training-serving skew
Models need the same features at training time and serving time. A feature store keeps one definition per feature and materialises it twice: an offline store, such as columnar files in a data lake, for training on history, and an online store, a low-latency key-value store, for lookups during inference in a few milliseconds. Computing features in two different code paths is the classic source of training-serving skew, where a model that scored well offline performs worse in production. Freshness matters too.
- Batch features: refreshed hourly or daily by pipelines (user's 30-day purchase count)
- Streaming features: updated in seconds from event streams (items viewed this session)
- Point-in-time correct joins prevent future data leaking into training examples
Model serving
Online inference sits on the request path, so it needs the same discipline as any service: a latency budget, autoscaling and fallbacks. A recommendation call with a 100 ms budget might spend 10 ms on feature lookups, 40 ms on candidate retrieval and 30 ms on ranking. GPU or accelerator capacity is expensive, so batch requests where latency allows, cache results for popular inputs, and precompute batch predictions for anything that does not need to be fresh. Always have a fallback, such as popular items or a simpler model, for when inference times out.
Monitoring and safe model rollout
Add ML-specific signals to the usual golden signals: input feature distributions and null rates, prediction distribution, and delayed quality metrics such as click-through or human-review agreement. Alert on drift when distributions move beyond a threshold. Roll out models like code: shadow mode first, scoring live traffic without acting on it, then a canary with an A/B comparison of business metrics. For human-in-the-loop systems like moderation, route low-confidence predictions to reviewers and use their decisions as fresh labels. Keep the previous model deployable so rollback is a configuration change.
Key takeaways
- ML failures are often silent, so monitor data and prediction quality
- A feature store with one definition per feature prevents training-serving skew
- Inference needs a latency budget, caching and a fallback
- Roll out models with shadow mode and canaries, like code
Sign in to track lessons and earn badges.