Online Feature Stores, on-demand features, and Feature Serving
Databricks Machine Learning Professional · Lesson 12 of 22 · 1:21:36
YouTube loads only after you press play. This chapter opens at its timestamp in the full course. Watch on YouTube ↗
Learning with these videos? Subscribe for new courses and exam-style questions.
Subscribe on YouTube (opens in a new tab)In this lesson
Prepare for the Databricks Certified Machine Learning Professional exam. In this lesson: Online Feature Stores (which replace online tables), publishing features and creating endpoints with the SDK, on-demand features computed at request time, and Feature Serving endpoints. Includes three original practice questions.
Study notes
The text of this lesson, to read at your own pace. Information as of November 2026.
Milliseconds
When the fraud model scores a payment, it needs the guest's booking history in a few milliseconds, and a query on a Delta table is far too slow for that. It also needs features that only exist at request time, like the distance between the guest and the home. This lesson covers Online Feature Stores, on demand features, and Feature Serving.
Online Feature Stores
An Online Feature Store keeps the latest feature values in a low latency database, so that models can look them up in milliseconds. It runs on Lakebase, the managed Postgres database of Databricks, and it replaces the older online tables. You create it from the feature engineering client with create_online_store, a name, and a capacity in Lakebase compute units, from one to eight, on Databricks Runtime sixteen point four LTS ML or above, or on serverless. Then publish_table copies a feature table into it: triggered mode, the default, syncs incrementally when you run it or on a schedule, continuous mode streams the changes within seconds, and snapshot mode copies everything each time. Triggered and continuous modes need change data feed on the source table, and only the latest value of each key is kept online.
Endpoints with the SDK
To serve a model that uses these features, you create a Model Serving endpoint, and the Databricks SDK does it from Python. WorkspaceClient, from the Databricks SDK, gives access to the workspace APIs: its serving_endpoints dot create takes the endpoint name, and a config with the served entities, each naming the registered model, its version, a workload size, and whether it can scale to zero. The model was logged with the feature engineering client, so it carries the lineage of its features, and the endpoint looks them up automatically in the online store, from the keys in each request. The same client also manages the online side, for example deleting an online table that is no longer needed.
On demand features
Some features can only be computed at request time, like the distance between the guest and the home, or the hours until check-in. An on demand feature is a Python function registered in Unity Catalog, created with CREATE FUNCTION and LANGUAGE PYTHON, which computes the value from inputs of the request or from looked up features. In create_training_set, a FeatureFunction names the function, its input_bindings, which map its parameters to columns, and an output_name, next to the FeatureLookups. The model is then logged with the feature engineering client, so score_batch and Model Serving run the same function at inference time. So training and production compute the feature from one definition, and they cannot drift apart.
Feature Serving
Feature Serving makes features available to applications that are not models, like a rules engine or a dashboard. You group the features and functions in a FeatureSpec, created with create_feature_spec from FeatureLookups and FeatureFunctions, and stored in Unity Catalog. A Feature Serving endpoint serves that spec: an application sends the keys and the request inputs, and receives feature values, computed or looked up in the online store. So the same definitions feed training sets, batch scoring, and live applications. But when the goal is a prediction, Databricks recommends serving the model itself, which looks up its features automatically through their lineage.
Recap
Let's recap. An Online Feature Store on Lakebase keeps the latest feature values for lookups in milliseconds. publish_table syncs a feature table in triggered, continuous, or snapshot mode, with change data feed for the first two. WorkspaceClient, from the Databricks SDK, creates serving endpoints, and served models look up their features automatically. On demand features are Python functions in Unity Catalog, used through a FeatureFunction in training and serving. And a FeatureSpec behind a Feature Serving endpoint serves features to applications without a model.
Quick checks for this lesson
The 3 questions of this lesson, as plain text. The button above runs them with shuffled choices and the reason behind every choice.
A feature table created long ago with default settings fails to publish in triggered mode. What is the likely cause?
- Change data feed is off on the source table
- The table has too many feature columns
- Triggered mode needs a Kafka source
- The model has not been registered yet
Show the answer
Change data feed is off on the source table
Triggered and continuous publishing read the change data feed of the source table, so it must be enabled first. “The table has too many feature columns” is not a limit of publishing. “Triggered mode needs a Kafka source” is wrong, since triggered mode reads a Delta table. And “The model has not been registered yet” is wrong, since publishing does not need a registered model.
The fraud model needs the hours until check-in, from the payment time and the check-in date. How should it be built so that training and serving agree?
- A column precomputed nightly in a feature table
- Code in the checkout application
- A Python UDF in Unity Catalog, through a FeatureFunction
- A Delta time travel query at scoring time
Show the answer
A Python UDF in Unity Catalog, through a FeatureFunction
The function lives in Unity Catalog, the training set calls it through a FeatureFunction, and the served model runs the same function on each request. “A column precomputed nightly in a feature table” is computed before the request, so the hours are already stale. “Code in the checkout application” would split the logic between the application and the training code. And “A Delta time travel query at scoring time” would have nothing to do with features computed at request time.
A host dashboard needs the latest booking statistics of a home, with low latency, and no model is involved. What fits?
- A Model Serving endpoint with a placeholder model
- A Feature Serving endpoint for a FeatureSpec
- A daily export of the feature table to a file
- A SQL query on the offline table for each request
Show the answer
A Feature Serving endpoint for a FeatureSpec
A Feature Serving endpoint returns feature values from the online store, for applications that need features without a model. “A Model Serving endpoint with a placeholder model” would add a model that does nothing. “A daily export of the feature table to a file” is neither fresh nor fast. And “A SQL query on the offline table for each request” would query the offline table, which is too slow for each request.