skip to content

Feature Store Platforms

Feast and managed services from Databricks, AWS and Google turn declared features into point-in-time training sets and online lookups. Interviewers ask which to run and what each one hides.

on this pageshow

explore

questions

12

With Feast, how do `get_historical_features` and `get_online_features` differ in what you pass, which store each reads, and which value each row receives?

level: juniorimportance: must knowfreq 18%

answer

  1. two calls, two stores
  2. entity dataframe carries timestamps
  3. entity rows carry only keys
  4. as-of value bounded by ttl
  5. online store filled by materialize or push

basics

~20 s

get_historical_features takes entity rows with timestamps, reads the offline store and returns each row's latest value at or before its timestamp within ttl; get_online_features takes keys only and returns the latest value loaded into the online store.

solid answer

~40 s

`get_historical_features(entity_df=..., features=...)` is the training and batch-scoring call: the entity dataframe holds join keys plus an `event_timestamp` per row, Feast runs a point-in-time join against the feature views' batch sources in the offline store, and each row gets the latest feature value observed at or before its own timestamp, looking back no further than the view's `ttl`. It returns a lazy `RetrievalJob` you turn into data with `.to_df()` or `.to_arrow()`. `get_online_features(features=..., entity_rows=...)` is the serving call: rows carry keys only, Feast reads the online store, and you get whatever latest value `feast materialize`, `materialize-incremental` or a push has written there, as an `OnlineResponse`. Pass the same `FeatureService` to both so training and serving ask for the same features.

code

python · 23 lines
python
from datetime import datetime, timezone
import pandas as pd
from feast import FeatureStore

store = FeatureStore(repo_path=".")
service = store.get_feature_service("offer_propensity_v1")

# Training: one row per player and the instant the offer was shown
entity_df = pd.DataFrame({
    "player_id": [1001, 1002],
    "event_timestamp": [
        datetime(2026, 9, 14, 18, 5, tzinfo=timezone.utc),
        datetime(2026, 9, 15, 9, 40, tzinfo=timezone.utc),
    ],
})
training_df = store.get_historical_features(
    entity_df=entity_df, features=service
).to_df()

# Serving: keys only, latest value in the online store
online = store.get_online_features(
    features=service, entity_rows=[{"player_id": 1001}]
).to_dict()

go deeper

for a junior

Recall the two calls, what each takes as entities, which store each reads, and that online values exist only after a materialize or a push.

for a middle

Explain the point-in-time rule per entity row, how ttl bounds the look-back from each row's timestamp, and why one FeatureService should feed both calls.

for a senior

Show how you would spot a training set built with now-timestamps, handle NOT_FOUND statuses at serving time, and log served features for later comparison.

for a principal

Weigh where the entity dataframe is built, as a dataframe or warehouse SQL, and what a shared FeatureService per model version buys a platform with many consumers.

## Two calls for two jobs Feast keeps feature definitions in one registry but answers two very different questions, and it has one retrieval call for each: - **`get_historical_features`** answers "what did this entity's features look like at each of these past moments?" It builds **training sets** and runs **batch scoring**. - **`get_online_features`** answers "what are this entity's features right now?" It serves a model that scores a live request. Both calls accept the features to fetch either as a list of **feature references** (`"player_spend:spend_7d"`, the `<feature_view>:<feature>` form) or as a **`FeatureService`**, the object that groups the features one model version reads. Feast's docs recommend references only while experimenting and a feature service once a model is trained or served, because the same service passed to both calls guarantees both paths request the same columns. ## What you pass in | | `get_historical_features` | `get_online_features` | |---|---|---| | Entities | `entity_df`: a pandas dataframe or a SQL string | `entity_rows`: a list of key dicts, such as `[{"player_id": 1001}]` | | Timestamps | required, one `event_timestamp` per row | none; one value per key is wanted | | Store read | the offline store, through each view's batch source | the online store, such as Redis or SQLite | | Returns | a lazy `RetrievalJob` (`.to_df()`, `.to_arrow()`) | an `OnlineResponse` (`.to_dict()`, `.to_df()`) | | Typical caller | a training pipeline, a nightly scoring job | a request handler, or the feature server's `/get-online-features` | The entity dataframe's `event_timestamp` is the **upper bound** for each row. In Feast 0.66 the docs also describe an entity-less form that takes `start_date` and `end_date` instead, supported only on some offline stores, and it cannot be mixed with `entity_df` in the same call. ## What value each row gets On the historical path Feast performs a **point-in-time join** for each entity row: 1. It finds feature rows for that entity key in the view's batch source. 2. It keeps only rows whose event timestamp is at or before the entity row's `event_timestamp`. 3. It scans back no further than the feature view's `ttl`, measured from that entity row's timestamp, not from the time you run the query. 4. It returns the latest surviving value, or a null when nothing survives. A `ttl` of 0, the default, means the features never expire, so the scan has no lower bound. Why an as-of join is needed at all is a design question for the material on point-in-time joins; here the point is that Feast does it for you when you supply timestamps. On the online path there is no time travel. The online store holds the latest value per entity key and feature view, and `get_online_features` returns it. Two consequences matter in practice: - **Nothing is there until something writes it.** A batch-sourced feature view has no online values until `feast materialize`, `feast materialize-incremental` or a push loads them; a key that was never loaded comes back with a null value and a `NOT_FOUND` status rather than an error. - **The online path does not re-check history.** In the ordinary read path `FeatureView.ttl` does not filter online reads; the Redis store's docs say so explicitly and point to its `key_ttl_seconds` setting for online expiry. ## A worked example For an in-app-offer propensity model, a `player` entity with join key `player_id` and a feature service `offer_propensity_v1` grouping 7-day spend and session features: - the training job builds `entity_df` from the offer-impression log, one row per player and the instant the offer was shown, and calls `get_historical_features` so each impression gets the spend value the game could have known then; - the game backend, at request time, sends `{"player_id": 1001}` to `get_online_features` or to the feature server's `/get-online-features` endpoint (port 6566 by default with `feast serve`) and gets the latest materialized values. ## Common mistakes - Calling `get_historical_features` with every timestamp set to now and calling it a training set: that is the batch-scoring pattern, and it labels past outcomes with present features. - Expecting `get_online_features` to fall back to the offline store when a key is missing; it does not. - Treating `get_historical_features` as eager: nothing runs until you convert the `RetrievalJob`. - Assuming a feature service deploys a service; applying one only records a named group of features in the registry.

  • What do you get from `get_online_features` for a player whose features were never materialized or pushed?
    No error. The response carries a null value for each requested feature of that key, with a `NOT_FOUND` status beside it. The online store is not backed by the offline store at read time, so a missing load shows up as nulls the model must handle, which is why the serving path should check statuses or default values deliberately.
  • How do you capture what the online path actually served, so it can later be compared with training data?
    Give the `FeatureService` a `logging_config`, a `LoggingConfig` with an offline-store logging destination and a `sample_rate` (1.0 by default). Logged rows are written to the offline store through `write_logged_features`, keyed by the feature service, and can then be read back and compared with the historical values for the same keys.
  • When would you pass a SQL string as `entity_df` instead of a dataframe?
    When the entity rows already live in the warehouse, such as every impression in a date range. Feast accepts a SQL query that returns the join keys and `event_timestamp`, so the join runs in the offline store without pulling the entity list into the client first.

  • get_online_features reads the offline store when a key is missing
  • get_historical_features returns today's values for every entity row
  • the entity dataframe does not need timestamps for training data
  • applying a FeatureService deploys an HTTP service
  • online values appear as soon as feast apply registers a feature view
open as a page

Compared with self-hosting Feast, what do Databricks Feature Store, SageMaker Feature Store and Agent Platform Feature Store each run for you?

level: juniorimportance: must knowfreq 14%

basics

~20 s

Feast layers over storage you run: your online database, your materialization schedule, your feature server. Each managed service provisions its online store, keeps it in sync with its offline store, and serves reads through its own API.

open as a page

With Feast, where does `feast materialize-incremental` take its start time from, and why can it skip warehouse rows that landed late?

level: middleimportance: should knowfreq 9%

basics

~20 s

feast materialize-incremental END_TS starts each feature view at the latest end recorded in the registry, or at now minus ttl on a first run. Rows stamped before that start are never loaded, however late they land.

open as a page

Why does a Feast training set from `get_historical_features` show nulls for a nightly `spend_7d` feature, and how does the FeatureView's `ttl` cause it?

level: middleimportance: should knowfreq 12%

basics

~20 s

A FeatureView's ttl caps how far back from each entity row's timestamp the historical join looks; a nightly value older than ttl at that instant is dropped, leaving a null. Set ttl above the refresh interval plus load delay.

open as a page

In Databricks Feature Store, why can a model logged with FeatureEngineeringClient.log_model be scored with only primary keys, and what breaks that?

level: middleimportance: should knowfreq 8%

basics

~20 s

fe.log_model stores the training set's FeatureLookup specifications with the model, so score_batch and Model Serving fetch the features by primary key themselves. Anything you did to load_df's DataFrame before training is not replayed at inference.

open as a page

In SageMaker Feature Store, what happens in each store when PutRecord sends a record whose event time is older than the stored one?

level: middleimportance: should knowfreq 7%

basics

~20 s

The offline store appends it, because it keeps every record. The online store ignores it, because it keeps only the latest event time per record identifier; an equal or newer event time would overwrite. GetRecord keeps returning the newer record.

open as a page

Session events pushed into a Feast PushSource with `store.push()` serve correctly online, yet `get_historical_features` never returns them for training - what causes this, and what do you change?

level: seniorimportance: should knowfreq 6%

basics

~20 s

store.push() and the feature server's /push default to PushMode.ONLINE, so pushed rows reach only the online store. Historical retrieval reads the view's batch source, which never received them; push with PushMode.ONLINE_AND_OFFLINE or land the same events in that table.

open as a page

When a team moves its features from Databricks, SageMaker or Agent Platform Feature Store onto self-hosted Feast, what carries over and what must be rewritten?

level: seniorimportance: should knowfreq 6%

basics

~20 s

Offline history mostly carries over, since it already sits in Delta tables, your S3 bucket or your BigQuery tables. Definitions, online read calls and feature-packaged Databricks models are rewritten, and the online store is rebuilt by materializing.

open as a page

An education platform's three teams run Databricks with Feast, AWS and Google Cloud; how do you decide between one self-hosted Feast and each cloud's managed feature store?

level: principalimportance: should knowfreq 5%

basics

~20 s

Decide per serving path on stated conditions: where each team's data lives, required freshness, who operates online stores, how often features cross teams, exit cost and service status. Managed stores fit native data that stays put; shared Feast fits features that travel.

open as a page

With Feast's `@on_demand_feature_view`, how do you compute a minutes-since-last-purchase feature known only at request time, and what must each retrieval call supply?

level: middleimportance: nice to knowfreq 5%

basics

~20 s

Declare a RequestSource for the request-time field, then an @on_demand_feature_view over it and a stored feature view; Feast runs the function in both retrieval calls. The field must appear in entity_df historically and in entity_rows online.

open as a page

Why do a stream job's `/push` calls to a Feast feature server with OIDC auth start failing once one `Permission` granting `READ_ONLINE` on feature services is applied?

level: seniorimportance: nice to knowfreq 3%

basics

~20 s

In Feast 0.66, once any Permission exists, a request no permission matches by resource and actions is refused with FeastPermissionError. /push needs write actions on feature views, so grant those to the stream job's role.

open as a page

After a Databricks fe.publish_table call without publish_mode, why do online features stop reflecting new rows in the Delta feature table, and what fixes it?

level: seniorimportance: nice to knowfreq 4%

basics

~20 s

publish_mode defaults to TRIGGERED: changes reach the Lakebase online store only when the publish or its pipeline runs again. Schedule that run, or publish with CONTINUOUS for a streaming sync. Both modes need Change Data Feed on the source table.

open as a page