Back to Catalog
Machine Learning
mlops
Feature Store
Centralizes the ingestion, storage, curation, and serving of features for training and real-time inference.
Intent & Description
A Feature Store decouples feature engineering from model development. It provides a single source of truth for features, serving them at low latency for real-time inference (online store) and in batch for training (offline store).
Real-world Use Case
Sharing computed user engagement metrics across multiple models (e.g., search ranking, home feed recommendations, ads personalization).
Advantages
- Eliminates training-serving skew by using identical feature definitions.
- Promotes feature reusability across different teams and models.
- Enables time-travel capabilities for training on historical datasets.
Disadvantages
- Significant architectural overhead and infrastructure cost.
Implementation Example
# Simplified online feature store database & lookup
class FeatureStore:
def __init__(self):
# Simulated low-latency key-value store (e.g., Redis)
self.online_db = {}
# Simulated high-throughput analytical store (e.g., Snowflake)
self.offline_db = []
def write_features(self, entity_id, features, timestamp):
# Ingest to both stores
self.online_db[entity_id] = features
self.offline_db.append({
"entity_id": entity_id,
"features": features,
"timestamp": timestamp
})
def get_online_features(self, entity_id):
# Low latency lookup for real-time inference
return self.online_db.get(entity_id, {})
# Usage
store = FeatureStore()
store.write_features("user_9081", {"clicks_1d": 12, "purchases_7d": 2}, "2026-06-06T09:00:00")
print(store.get_online_features("user_9081"))