Sub topic 2
How Feast Is Organized: Registry, Offline Store, and Online Store
This chapter assumes Python basics, pandas, the command line, and the difference between training data and inference. You should also understand that batch data is processed in larger groups, while online serving responds to one request at a time.
The three-part feature store
Feast separates feature definitions from feature values and uses different storage systems for different access patterns.
- The registry stores feature definitions and metadata. It records entities, feature views, schemas, sources, and feature services. It does not normally store every feature value.
- The offline store holds historical feature data. Training jobs read large time ranges from it.
- The online store holds the latest materialized values. Inference services read small amounts of data from it with low latency.
A feature repository is the project directory containing Python definitions and feature_store.yaml. The repository describes how Feast connects to each store.
| Component | Main purpose | Typical access |
|---|---|---|
| Registry | Track feature definitions and metadata | Repository and deployment operations |
| Offline store | Build historical training data | Large batch queries |
| Online store | Serve current feature values | Low-latency key lookups |
How data moves through Feast
A data source, such as a Parquet file or warehouse table, contains feature values and timestamps. A FeatureView describes how those values are interpreted. It includes the entity keys, feature names and types, source, and optional time-to-live setting.
When you run feast apply, Feast reads the repository definitions and writes their metadata to the registry. This makes the definitions available to retrieval commands and other Feast components.
Materialization then copies eligible recent values from the offline source into the online store. The online store is therefore a serving copy, not the original historical dataset.
Configuring a local repository
This minimal configuration uses a local registry, SQLite as the online store, and files as the offline store.
project: driver_project
registry: data/registry.db
provider: local
online_store:
type: sqlite
path: data/online_store.db
offline_store:
type: fileThe project name identifies the Feast project. The registry path identifies the metadata database. The provider selects the implementation used by Feast. The store sections select where feature values are read from and served.
Run the repository commands from the directory containing this file:
feast apply
feast materialize-incremental "$(date -u +"%Y-%m-%dT%H:%M:%S")"feast apply registers definitions. feast materialize-incremental updates the online store through the timestamp supplied to it. A production system usually replaces these local stores with managed warehouse, lake, cache, or database services and schedules materialization separately.
Choosing the access path
Use the offline path when you need history, many rows, or point-in-time training data. Use the online path when a model request needs the latest values for a small set of entity keys. Keeping both paths tied to the same FeatureView definitions reduces the chance that training and serving use different feature names or types.
Exercise
Why does Feast need both an offline store and an online store?
Show answer
The offline store supports large historical reads for training, while the online store supports low-latency reads of recent materialized values during inference.