When you run ML models online, you need a way to fetch the same features used during training with low latency. Databricks Feature Serving delivers Feature Store tables on Unity Catalog through dedicated endpoints, ensuring training-serving consistency (using the same feature definitions for both training and inference). This article walks through how Feature Serving works, how to configure Online Tables, how to create endpoints, and how to keep training and serving consistent.
Batch inference can read features directly from Delta tables, but for online inference (real-time API requests) querying Delta tables is too slow (seconds to tens of seconds). Feature Serving addresses the following challenges:
| Concern | Batch inference | Online inference (Feature Serving) |
|---|---|---|
| Latency requirement | Seconds to minutes (acceptable) | Milliseconds to tens of ms (low latency required) |
| Feature source | SELECT directly from Delta tables | Via Online Table (KV store) |
| Training-Serving consistency | Naturally consistent since the same table is read | Guaranteed by using the Feature Store as the single definition |
| Scalability | Depends on cluster compute capacity | Autoscaling on the endpoint |
[Training]
│ Feature Engineering in UC
│ fe.create_training_set(
│ entity_df, feature_lookups=[...])
│ → Looks up features at training time
v
[Feature Table (Delta, UC)]
│ Source tables
│ ├─ customer_features (customer_id, avg_spend, ...)
│ └─ product_features (product_id, category, ...)
v
[Online Table]
│ Incremental sync from Delta (Snapshot / Triggered / Continuous)
│ → Converted into a low-latency KV store
v
[Feature Serving Endpoint]
│ REST API (POST /serving-endpoints/{name}/invocations)
│ → Returns the feature vector keyed by customer_id
v
[Model Serving / Application]
│ Features + real-time input → inference resultAn Online Table syncs a Delta table into a low-latency KV store. Create one by specifying the source Delta table (the Feature Table) and a primary key.
-- Create an Online Table (SQL)
CREATE ONLINE TABLE ml.features.customer_features_online
SOURCE ml.features.customer_features
PRIMARY KEY (customer_id)
SYNC MODE TRIGGERED;| Sync mode | Behavior | Latency | Cost |
|---|---|---|---|
| SNAPSHOT | Periodically snapshot the entire dataset | Depends on the sync interval (minutes to hours) | Low |
| TRIGGERED | Manually triggered CDC incremental sync | Updated when the trigger runs | Medium |
| CONTINUOUS | Always-on streaming incremental sync | Near real-time (seconds to minutes) | High (always running) |
Match the primary key to the lookup key on the Feature Table. Composite keys are also supported (for example, PRIMARY KEY (customer_id, product_id)).
Create a Feature Serving Endpoint with the Python SDK (databricks-feature-engineering).
from databricks.feature_engineering import FeatureEngineeringClient
from databricks.feature_engineering.entities.feature_serving_endpoint import (
EndpointCoreConfig,
ServedEntity,
)
fe = FeatureEngineeringClient()
fe.create_feature_serving_endpoint(
name="customer-features-endpoint",
config=EndpointCoreConfig(
served_entities=ServedEntity(
feature_table_name="ml.features.customer_features",
scale_to_zero_enabled=True,
)
)
)Setting scale_to_zero_enabled to True scales the endpoint down to zero during idle periods, reducing cost. The trade-off is added latency on cold start — for strict SLAs, set it to False and keep the endpoint warm at all times.
import requests
import json
endpoint_url = "https://<workspace-url>/serving-endpoints/customer-features-endpoint/invocations"
headers = {"Authorization": "Bearer <token>", "Content-Type": "application/json"}
payload = {
"dataframe_records": [
{"customer_id": "C001"},
{"customer_id": "C002"}
]
}
response = requests.post(endpoint_url, headers=headers, json=payload)
features = response.json()
# => {"dataframe_records": [
# {"customer_id": "C001", "avg_spend": 150.5, "total_orders": 42, ...},
# {"customer_id": "C002", "avg_spend": 89.2, "total_orders": 15, ...}
# ]}Training-serving skew — when feature definitions or computations differ between training and inference — is one of the biggest pitfalls undermining ML system reliability. Databricks Feature Engineering in Unity Catalog resolves this structurally:
from databricks.feature_engineering import FeatureEngineeringClient, FeatureLookup
fe = FeatureEngineeringClient()
training_set = fe.create_training_set(
df=labels_df, # Labels dataframe (customer_id, label)
feature_lookups=[
FeatureLookup(
table_name="ml.features.customer_features",
lookup_key=["customer_id"],
),
FeatureLookup(
table_name="ml.features.product_features",
lookup_key=["product_id"],
),
],
label="label",
)
training_df = training_set.load_df()
# Log the model (feature lineage is recorded automatically)
fe.log_model(
model=trained_model,
artifact_path="model",
flavor=mlflow.sklearn,
training_set=training_set,
registered_model_name="ml.models.recommendation_model",
)Models logged with fe.log_model embed references to their feature tables. When such a model is deployed to Model Serving, features are automatically looked up via Feature Serving on each inference request (Feature Function).
| Item | Recommendation | Why |
|---|---|---|
| Primary key design | Natural entity key (e.g., customer_id) | Guarantees lookup uniqueness |
| Feature table granularity | One table per entity | Bloated tables increase Online Table sync cost |
| Feature freshness requirement | Pick the Online Table sync mode that fits the use case | Real-time recommendations → Continuous; daily batch → Snapshot |
| High-cardinality features | Bucket or categorize during preprocessing | Keeps the Online Table's row count and size in check |
| Endpoint scaling | Decide on scale_to_zero based on QPS requirements | Low QPS → scale_to_zero; high QPS → always on |
ML Associate / ML Professional
問題 1
An ML engineer is building an online recommendation system. The model was trained by looking up customer features from a Delta table. At inference time, the engineer wants to fetch the same features with low latency and keep the feature definitions identical between training and serving. Which approach is best?
正解: A
Centralizing features in Feature Engineering in UC, syncing them to a low-latency KV store via Online Table, and serving them through a Feature Serving Endpoint gives you both training-serving consistency and low latency. Direct queries against Delta cannot meet the latency requirement. CSV exports cannot track feature updates. MLflow model artifacts contain model parameters but not the feature data itself.
What is the difference between Feature Serving and Model Serving?
Model Serving deploys the ML model itself as an endpoint that takes input data and returns inference results. Feature Serving is an endpoint that retrieves feature vectors for a given key from a feature table with low latency. A typical setup involves two requests: the client first fetches features via Feature Serving, then passes those features to Model Serving for inference. With Feature Functions, you can also unify the two so Model Serving automatically looks up features internally.
How often is an Online Table updated?
Online Tables support three sync modes: (1) Snapshot — manually or on a schedule, snapshot the entire source Delta table; (2) Triggered — manually triggered incremental sync via CDC (change data capture); (3) Continuous — always-on streaming incremental sync (lowest latency, highest cost). Choose the mode that balances freshness and cost for your use case.
Can features that are not managed by the Feature Store be served via Feature Serving?
Feature Serving endpoints serve features from Feature Store tables on Unity Catalog (Feature Engineering in Unity Catalog). You cannot directly serve a table that is not registered with the Feature Store. However, registering any Delta table as a Feature Store table (a Feature table on UC) is straightforward — use the CREATE FEATURE TABLE statement or the Python API.
Practice with certification-focused question sets
無料で問題を解いてみるNicheeLab Editorial Team
NicheeLab editorial team focused on data engineering and cloud certification learning. Content is structured around practical study needs and official exam domains.
Databricks Certifications: All 7 Exams, Difficulty & Study Plan (2026)
Complete guide to all 7 Databricks certifications — Data Eng...
Databricks Exam Difficulty Ranking: All 7 Certs Compared (2026)
Every Databricks certification ranked by difficulty, with st...
Databricks Study Guide: Fastest Pass Route & Time Estimates (2026)
How to pass Databricks certifications efficiently. Official ...
Databricks Data Engineer Associate: Complete Guide (2026)
Domain-by-domain breakdown of the Databricks Certified Data ...
Databricks Data Engineer Professional: Complete Guide (2026)
Tactics for the Databricks Certified Data Engineer Professio...