Course contentsShow
← Machine Learning and Deep Learning
Lesson 2884 of 3,53862. ML Pipelines and OrchestrationFree lesson

Offline vs Online Feature Stores

When to use batch feature computation for training versus real-time feature serving for inference.

Offline vs Online Feature Stores

You'll learn when to use batch feature computation for training versus real-time feature serving for inference.

The Two Sides of Feature Serving

A feature store isn't one system—it's two complementary systems serving different needs:

Offline Feature Store: Think of this as your historical feature warehouse. It stores large volumes of pre-computed features using batch processing (e.g., Spark, BigQuery). You use it during training when you need to generate massive datasets with point-in-time correct features from historical data. Speed isn't critical here; correctness and volume are.

Online Feature Store: This is your low-latency serving layer. It stores the latest feature values in fast key-value stores (e.g., Redis, DynamoDB) for real-time inference. When a user requests a prediction, you need features in milliseconds—not minutes.

When to Use Each

Use Offline for:

  • Training dataset generation
  • Batch scoring (predictions on large datasets)
  • Experimentation and feature exploration
  • Historical analysis with point-in-time correctness

Use Online for:

  • Real-time predictions (web apps, APIs)
  • Sub-second latency requirements
  • Serving fresh features to production models
  • Low-volume, high-frequency access patterns

The Synchronization Challenge

The critical design decision: how do features flow from offline to online? Typically, features are computed in batch (offline), then synchronized to the online store periodically. This ensures training-serving consistency—both environments use the same feature computation logic.

Key Takeaway: Offline feature stores prioritize historical correctness and batch scale for training, while online feature stores optimize for low-latency access during inference. Most production systems need both, with a synchronization mechanism connecting them.