a month ago
Hi Team,
We are implementing Databricks Online Feature Store using Lakebase architecture and have run into some constraints during development:
Requirements:
Problem: When an endpoint is running and we delete/recreate the online table and feature spec (to reflect schema changes), the endpoint breaks. In some cases, it even becomes irrecoverable.
Constraints:
Question: What is the recommended approach to safely update the online store and feature spec without causing downtime or breaking the endpoint? Is there a supported pattern for atomic updates or versioning in Databricks Feature Store?
Thanks for your guidance!
#lakehouse #databricksonlinefeaturestore #syncedtable #postgres #onlinefeaturestore
a month ago
Additional Context:
4 weeks ago
The recommended way to safely update an online Databricks Feature Store without breaking the serving endpoint or causing downtime involves a version-controlled, atomic update pattern that preserves schema consistency and endpoint stability.
When an online feature table is deleted and recreated due to a schema change, the associated endpoint and feature spec lose binding references, rendering the endpoint unstable. Databricks currently does not support true in-place schema replacement for synced online tables — any schema change to the offline Delta source requires synchronization through a publish or merge update, not recreation.
Databricks Delta Tables support schema evolution, allowing columns to be added or updated without deleting the table. You can use:
fs.write_table(
name="catalog.schema.feature_table",
df=new_feature_df,
mode="merge" # merges updates safely
)
This approach updates the schema and data without breaking existing bindings between the offline and online tables.
Instead of deleting the online table, use:
fe.publish_table(
source_table_name="catalog.schema.feature_table",
online_table_name="catalog.schema.online_table",
online_store=online_store,
mode="merge"
)
mode="merge" ensures the online table schema and data are updated incrementally while keeping its identity (and thus the endpoint bindings) intact. This prevents downtime and maintains endpoint stability.
If schema changes or feature updates are frequent, schedule Lakeflow Jobs to regularly call publish_table. This approach makes the feature update process continuous and fault-tolerant without manual deletion or recreation.
Databricks recommends maintaining versioned feature specifications (for example, feature_spec_v1, feature_spec_v2), while keeping a constant endpoint mapping. During deployment, update the endpoint’s configuration reference to the new spec version atomically. The endpoint name and URL remain unchanged.
Update offline Delta table schema (enable CDF if not already set).
Write or merge new features using schema evolution.
Republish the updated offline table to the online store using mode="merge".
Update the feature spec version — do not delete the online table.
Redeploy endpoint referencing the new feature spec (same URL).
| Problem | Corrective Practice |
|---|---|
| Schema change causes endpoint breakage | Use Delta schema evolution with mode="merge" |
| Need uninterrupted endpoint (stable URL) | Reuse endpoint, only version feature spec |
| Frequent schema changes | Use Lakeflow jobs for automated sync |
| Avoid dual tables for one offline source | Use incremental publish_table to preserve online identity |
This workflow ensures atomic updates, zero downtime, and endpoint continuity while enabling schema flexibility under Databricks’ Online Feature Store using Lakebase architecture.
3 weeks ago
Hi Mark,
Thanks for your response. I followed the steps you suggested:
A LakeFlow pipeline was triggered and threw the following error:
org.apache.spark.sql.streaming.StreamingQueryException: [STREAM_FAILED] ... [DELTA_SCHEMA_CHANGED_WITH_STARTING_OPTIONS] Detected schema change in version 7
It seems the schema change isn’t being handled during re-publication. I’ve attached the full error message. Let me know if you need more details or logs.
Passionate about hosting events and connecting people? Help us grow a vibrant local community—sign up today to get started!
Sign Up Now