Chapter 04 of 12

Feature Stores

Your data superpower - learn how feature stores work and why your data warehouse skills make you the ideal feature store architect.

What is a Feature Store?

A Feature Store is a centralized system for storing, managing, and serving ML features. Think of it as a data warehouse designed specifically for ML.

Your Data Warehouse Parallel

Data Warehouse: Central store for analytics - dashboards consume it
Feature Store: Central store for ML features - models consume it

Why Feature Stores Exist

Training-Serving Skew

Features computed differently during training vs serving cause wrong predictions. Feature stores compute once, serve everywhere.

Feature Duplication

10 teams build the same feature differently. Feature stores provide a single source of truth.

Slow Discovery

Data scientists spend weeks finding features that already exist. Feature stores have catalogs.

Latency

Real-time models need features in milliseconds. Feature stores pre-compute and cache.

Offline vs Online Store

AspectOffline StoreOnline Store
PurposeTraining (historical)Serving (real-time)
LatencySeconds-minutesMilliseconds
StorageData warehouse / lakeRedis, DynamoDB
PatternLarge batch scansPoint lookups

Complete Feast Example

# Install: pip install feast
# Initialize: feast init customer_features

# feature_repo/features.py
from feast import Entity, FeatureView, Field, FileSource
from feast.types import Float32, Int64
from datetime import timedelta

customer = Entity(name="customer_id", description="Customer ID")

customer_source = FileSource(
    path="data/customer_features.parquet",
    timestamp_field="event_timestamp",
)

customer_features = FeatureView(
    name="customer_features",
    entities=[customer],
    ttl=timedelta(days=90),
    schema=[
        Field(name="total_orders", dtype=Int64),
        Field(name="avg_order_value", dtype=Float32),
        Field(name="satisfaction_score", dtype=Float32),
        Field(name="engagement_score", dtype=Float32),
    ],
    source=customer_source,
    online=True,
)

Use for Training (Offline)

from feast import FeatureStore
store = FeatureStore(repo_path="feature_repo/")

training_df = store.get_historical_features(
    entity_df=entity_df,
    features=[
        "customer_features:total_orders",
        "customer_features:satisfaction_score",
    ],
).to_df()

Use for Serving (Online)

# Same features, served in real-time (<10ms)
online_features = store.get_online_features(
    features=["customer_features:total_orders"],
    entity_rows=[{"customer_id": "C00001"}],
).to_dict()

# No training-serving skew - same pipeline!

Feature Store Tools

ToolTypeBest For
FeastOpen-sourceLearning, custom setups
TectonManaged SaaSEnterprise real-time ML
HopsworksOpen-source/CloudFull ML platform
Databricks FSPlatformDatabricks users
Vertex AI FSGCP ManagedGCP users
SageMaker FSAWS ManagedAWS users
Your Edge

Feature store design is data modeling + pipeline engineering + serving infrastructure. All your core skills!