This guide takes you from an empty machine to a working feature store serving
the AcmeCorp retail-risk features shipped in this package. It assumes Python
3.9+ and basic comfort with the command line.
Feast is modular: you install the framework plus the extras for the stores you
use. For the default config in feature_repo/feature_store.yaml (Redis online,
file offline) you need:
python -m venv .venv && source .venv/bin/activate
pip install "feast[redis]" pandas pyarrowFor a zero-infrastructure local run, you can skip Redis entirely and use the
SQLite online store (see step 4). Other common extras: feast[aws],
feast[gcp], feast[snowflake], feast[postgres].
feature-store-bootstrap/
src/feature_store/ importable library (definitions + helpers)
definitions.py entities, sources, batch feature views, services
transformations.py pure feature logic + on-demand feature views
ingestion.py materialize / push helpers
retrieval.py training + serving retrieval helpers
registry.py apply / describe / teardown helpers
feature_repo/
feature_store.yaml the project config Feast reads
example_repo.py the file `feast apply` scans (imports the library)
data/ parquet fixtures + registry.db (created on first run)
The split between src/feature_store/ (a tested library) and feature_repo/
(a thin Feast entry point) is deliberate. Feature logic lives in version-
controlled, unit-tested Python; the repo file just imports and re-exports it so
Feast can discover the objects. As your feature set grows past a single file,
this scales far better than one monolithic example_repo.py.
feature_store.yaml has five things Feast must know:
| Key | What it controls | Production swap |
|---|---|---|
project | Namespace for the registry + online keys | Keep stable; renaming orphans data |
registry | Where the object catalogue lives | sql registry on Postgres for teams |
provider | Default stores + materialization engine | aws / gcp for managed infra |
online_store | Low-latency serving backend | Redis / DynamoDB / Bigtable |
offline_store | Historical retrieval backend | BigQuery / Snowflake / Redshift |
entity_key_serialization_version: 2 should always be set on new projects --
it is a more compact online-store key encoding. Do not change it on an existing
project, as it would invalidate already-materialized keys.
Edit feature_repo/feature_store.yaml, comment the redis block, and uncomment
the SQLite alternative:
online_store:
type: sqlite
path: data/online_store.dbSQLite is single-process and slow under load -- perfect for development and CI,
never for production serving.
apply is idempotent: it diffs your definitions against the registry and
creates/updates/deletes objects to match. Run it from the repo directory:
cd feature_repo
feast applyYou should see Feast create the entities, feature views, on-demand view, and the
two feature services. Equivalently, from Python:
from feast import FeatureStore
from feature_store.registry import RegistryManager
store = FeatureStore(repo_path="feature_repo")
RegistryManager(store).apply() # registers everything
RegistryManager(store).describe() # prints what is now in the registryMaterialization copies feature values from the offline store into the online
store so they can be served in milliseconds.
# One-off backfill of an explicit window:
feast materialize 2024-01-01T00:00:00 2024-01-08T00:00:00
# Scheduled top-up since the last run (the cron-friendly command):
feast materialize-incremental $(date -u +"%Y-%m-%dT%H:%M:%S")In Python, prefer the helpers in ingestion.py -- they add logging and return
an IngestionStats you can emit to your metrics system:
from feature_store.ingestion import materialize_window, materialize_incremental
materialize_window(store, days=7) # explicit backfill
materialize_incremental(store) # scheduled top-upScheduled materialization has a built-in lag equal to your cron interval. For
features that must be near-real-time (transaction velocity, for example), stream
updates through the PushSource:
from feature_store.ingestion import push_micro_batch
push_micro_batch(store, "customer_txn_push_source", fresh_df, mode="online")mode="online_and_offline" also appends to the offline store so the pushed
value is available for future training joins -- use it when the streamed
aggregate should become part of the historical record.
A minimal production cadence:
feast materialize-incremental for slowly-changing views(profiles, merchant stats) via Airflow / Cron / GitHub Actions.
push_micro_batch for fast-movingaggregates.
feast apply in CI so registry changes ship withcode. Pin the Feast version in requirements.txt so apply behaviour is
reproducible.
| Symptom | Likely cause | Fix |
|---|---|---|
feast apply finds no objects | Repo file did not import the definitions | Confirm example_repo.py re-exports them and ../src is importable |
Online lookup returns all None | Features never materialized, or entity key absent | Run materialize-incremental; verify the customer_id exists |
| Training values look "from the future" | Entity timestamp earlier than feature event time | Set the entity event_timestamp to the label time, not now |
ConnectionError to Redis | Online store unreachable | Start Redis or switch to the SQLite online store |
| Stale features in a long-running server | Registry cached | Set registry.cache_ttl_seconds or call RegistryManager.refresh() |
With apply, materialize, and serve working, move on to
feature-engineering-patterns.md for how to design features that stay correct
in production.
Get the full Feature Store Bootstrap and unlock everything.
Get the complete guide with every chapter unlocked, including code samples, diagrams, and best practices.
Access all interactive tools with complete data, all workload profiles, and the full scenario library.
Downloadable source code, configuration files, and working examples from every chapter.
Free updates for life. Every new chapter, tool, and improvement included.