AI Dictionary of Terms

Feature Store

A centralized infrastructure layer that manages, stores, and serves machine learning features (transformed input variables) for both training and inference — ensuring consistency between offline training and online serving while enabling feature reuse across multiple models.

The Simple Version

Imagine a restaurant chain with 100 locations. Each location independently sources ingredients, prepares recipes, and manages inventory. It’s chaotic, inconsistent, and inefficient.

Now imagine a central kitchen that prepares all the ingredients (chopped vegetables, sauces, pre-cooked proteins) and distributes them to all locations. Every restaurant uses the same high-quality ingredients, ensuring consistent dishes across all locations.

A feature store is the “central kitchen” for machine learning. Instead of each ML team independently transforming raw data into features (e.g., “customer_lifetime_value,” “average_purchase_amount”), the feature store manages these features centrally. All models use the same feature definitions, ensuring consistency and enabling reuse.

Without a feature store: Team A calculates “customer_age” one way, Team B calculates it differently. Models are inconsistent, and there’s duplication of effort.

With a feature store: “customer_age” is defined once, stored centrally, and used by all models consistently.

Detailed Explanation

Feature stores solve the “training-serving skew” problem and enable feature reuse across an organization’s ML ecosystem.

The Training-Serving Skew Problem:

How Feature Stores Solve This:

  1. Define features once (feature registry)
  2. Compute offline for training (batch materialization)
  3. Serve online for inference (low-latency retrieval)
  4. Ensure consistency between offline and online

Core Components:

1. Feature Registry:

2. Offline Store:

3. Online Store:

4. Feature computation:

Feature Store Workflow:

Training Workflow:

  1. Data scientist defines feature in registry
  2. Feature store computes feature from raw data (batch)
  3. Features materialized in offline store
  4. Model training reads features from offline store
  5. Model trained with consistent, reusable features

Serving Workflow:

  1. Inference request arrives with entity ID (e.g., customer_id)
  2. Model serving retrieves features from online store (<10ms)
  3. Features passed to model for prediction
  4. Prediction returned to user

Popular Feature Store Platforms:

1. Feast (Open Source):

2. Tecton:

3. Databricks Feature Store:

4. Hopsworks:

5. Cloud-Native Solutions:

Key Characteristics

Business Context

Feature stores are critical for enterprise ML at scale:

Why They Matter:

Enterprise Benefits:

ROI Example:

When to Use a Feature Store:

When Not to Use:

Real-World Analogy

A library’s catalog system. Instead of each reader independently searching for books (inefficient, inconsistent), the library maintains a centralized catalog. Readers search the catalog (feature registry), find the book location (feature store), and retrieve the book (feature retrieval). The catalog ensures everyone finds the same book in the same location, enabling efficient, consistent access.

Code Example

# Feature store with Feast (open-source)
from feast import FeatureStore, Entity, FeatureView, Field
from feast.types import Float32, Int64
from datetime import timedelta

# 1. Define an entity (the thing we're computing features for)
customer = Entity(
    name="customer",
    description="A customer of our service",
    join_keys=["customer_id"],
)

# 2. Define a feature view (a group of related features)
customer_features = FeatureView(
    name="customer_features",
    entities=[customer],
    ttl=timedelta(days=1),  # Features expire after 1 day
    schema=[
        Field(name="customer_lifetime_value", dtype=Float32),
        Field(name="average_purchase_amount", dtype=Float32),
        Field(name="days_since_last_purchase", dtype=Int64),
    ],
    source=...,  # Data source (BigQuery, Snowflake, etc.)
)

# 3. Apply definitions to the feature store
store = FeatureStore(repo_path=".")
store.apply([customer, customer_features])

# 4. Materialize features (compute and store in online store)
store.materialize_incremental(
    start_date=datetime.now() - timedelta(days=1),
    end_date=datetime.now()
)

# 5. Retrieve features for training (offline)
training_df = store.get_historical_features(
    entity_df=entity_df,  # DataFrame with customer_ids and timestamps
    features=[
        "customer_features:customer_lifetime_value",
        "customer_features:average_purchase_amount",
        "customer_features:days_since_last_purchase",
    ],
).to_df()

# Use training_df to train model
model.fit(training_df[features], training_df[target])

# 6. Retrieve features for serving (online, low-latency)
online_features = store.get_online_features(
    features=[
        "customer_features:customer_lifetime_value",
        "customer_features:average_purchase_amount",
        "customer_features:days_since_last_purchase",
    ],
    entity_rows=[{"customer_id": 12345}],
).to_dict()

# Use online_features for real-time prediction
prediction = model.predict(online_features)

Common Misconceptions

Sources & Further Reading