# Feature stores are the data layer for ML systems - storing reusable, versioned feature pipelines that serve both training and inference

**Date:** 2025-12-18  
**Tags:** MLOps, ML, Data  
**URL:** https://kelexine.is-a.dev/til/mlops-feature-stores

---

TIL: Feature stores are the data layer for ML systems - storing reusable, versioned feature pipelines that serve both training and inference. Key benefits: consistency between training/serving, feature reuse across models, point-in-time correctness for training data, and real-time feature serving.


```python
# Feature store pattern
from feast import FeatureStore

fs = FeatureStore('feature_repo/')

# Define features once
user_features = fs.get_feature_view('user_activity')

# Serve in training (historical)
training_df = fs.get_historical_features(
    entity_df, features=['user_clicks', 'user_purchases']
)

# Serve in inference (real-time)
online_features = fs.get_online_features(entity_rows)
```




---

*This content is available at [kelexine.is-a.dev/til/mlops-feature-stores](https://kelexine.is-a.dev/til/mlops-feature-stores)*
