skip to content

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%

answer

  1. the sync only runs when asked
  2. default publish mode
  3. a schedule or a streaming pipeline
  4. Change Data Feed on the source
  5. one sync per online table

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.

solid answer

~40 s

`fe.publish_table` creates the online table, copies the data and sets up a sync pipeline, but `publish_mode` defaults to `TRIGGERED`. That mode applies offline changes incrementally only when the sync is triggered: a scheduled Lakeflow Job that calls `publish_table` again, or a schedule on the returned pipeline. A one-off publish from a notebook therefore freezes online values with no error. `CONTINUOUS` runs a streaming pipeline that updates the store as rows are written, and `SNAPSHOT` copies everything once. `TRIGGERED` and `CONTINUOUS` both require `delta.enableChangeDataFeed` on the source, along with a non-null primary key. Only one sync may run per online table, so concurrent publishers get a skip error. Use one publish task at the end of the job, or wait with `get_status()`.

code

python · 17 lines
python
from databricks.feature_engineering import FeatureEngineeringClient

fe = FeatureEngineeringClient()

# TRIGGERED and CONTINUOUS both read the table's change feed
spark.sql("""
  ALTER TABLE edu.learning.course_affinity
  SET TBLPROPERTIES ('delta.enableChangeDataFeed' = 'true')
""")

store = fe.get_online_store(name="edu-online")
fe.publish_table(
    online_store=store,
    source_table_name="edu.learning.course_affinity",
    online_table_name="edu.learning.course_affinity_online",
    publish_mode="CONTINUOUS",   # omitted -> "TRIGGERED": syncs only when re-run
)

go deeper

for a junior

Recall the three publish modes, TRIGGERED, CONTINUOUS and SNAPSHOT, and which one applies when publish_mode is omitted.

for a middle

Explain what each mode does after the first publish, and the source-table preconditions: a non-null primary key and Change Data Feed.

for a senior

Diagnose frozen online values with no error: check the mode, what re-triggers it, Change Data Feed, and overlapping publishers. Then choose a schedule or a streaming pipeline.

for a principal

Set a per-table rule for how stale online values may be, and price a standing streaming pipeline against scheduled incremental syncs across the estate.

## What publish_table sets up A **Databricks Online Feature Store** is a Lakebase-backed store created with `fe.create_online_store(name=..., capacity=...)`. Capacity is given in Lakebase compute units: `CU_1`, `CU_2`, `CU_4` or `CU_8`. Feature tables reach it through `fe.publish_table(online_store=..., source_table_name=..., online_table_name=...)`. According to the documentation, one call: 1. creates the online table if it does not exist; 2. syncs the feature data from the offline Delta table; 3. sets up the infrastructure that keeps the online table in sync. How that sync behaves afterwards is decided by the optional `publish_mode` argument. When it is left out, it defaults to `TRIGGERED`. ## The three publish modes | `publish_mode` | What it does | Needs Change Data Feed | Typical use | |---|---|---|---| | `TRIGGERED` (default) | Incrementally applies offline changes when the sync is triggered through the API or on a schedule | Yes | Batch feature tables refreshed by a job | | `CONTINUOUS` | Runs a streaming pipeline that updates the online store as new data is written | Yes | Features written continuously or by streams | | `SNAPSHOT` | Performs a one-time copy of all source data | No | Many updates to existing rows between syncs | `publish_mode` replaced an older boolean `streaming` argument. For backward compatibility, passing `streaming=True` still works and means `CONTINUOUS`. ## Why new rows stop arriving With the default mode, nothing pushes later writes online by itself. A team that called `publish_table` once from a notebook, then kept appending to the Delta table, sees the online values freeze at that first sync. There is no error. Model Serving and Feature Serving endpoints keep answering with the last synced values. To diagnose it: 1. **Check the mode.** If `publish_mode` was omitted, it is `TRIGGERED`. 2. **Check whether anything re-triggers it.** The docs give two options: a scheduled Lakeflow Job that runs a notebook calling `publish_table` again, or a schedule on the pipeline whose id `publish_table` returns. 3. **Check Change Data Feed.** Both `TRIGGERED` and `CONTINUOUS` need `delta.enableChangeDataFeed = true` on the source table. The table also needs a primary key constraint with non-null key columns. 4. **Check for overlapping publishes.** Only one sync may run per online table at a time. A second caller gets *"Skipping publishing to online table '...' because the feature sync pipeline is already running."* Run a single publish task at the end of the job, or wait with `get_status()`. ## Fixing it - **Keep `TRIGGERED` and schedule it** after each job that writes the feature table. This suits a nightly course-recommendation refresh. - **Switch to `CONTINUOUS`** when values are written throughout the day and should be online as soon as they land. You then run a standing streaming pipeline instead of scheduled runs. - **Use `SNAPSHOT`** when most rows change between syncs and copying everything is cheaper than applying changes. ## Details that change what lands online - **Time series tables.** A table created with time series designation publishes only the latest values per entity, deduplicating older rows. A table without it publishes every row, for exact-match lookups such as back-testing a past prediction. Neither gives an as-of query online. - **Several online tables.** If one feature table is published to more than one online table, serving endpoints always resolve to the *oldest* online table, by creation time. A freshly created second table is never read. - **Unsupported arguments.** `filter_condition`, `checkpoint_location`, `mode`, `trigger` and `features` are not supported when publishing to a Databricks online store. - **Deleting.** `w.feature_store.delete_online_table(...)` from the Databricks SDK is the recommended deletion route. A SQL `DROP TABLE` leaves the data in the database. ## Capacity and cost notes - An online store keeps incurring cost while it exists. Databricks advises deleting stores you no longer use, sharing one store across projects in development, and starting at `CU_2` before resizing. - A store can have up to three read replicas, set with `read_replica_count`, to spread read traffic. - Disabling high availability breaks connectivity for endpoints that read the store until they restart. The documented way to change it is blue/green: build a new store, publish to it, then move the endpoints. ## The judgement call The mode is a cost-against-staleness choice made per feature table. Decide how old a served value may be from the model's needs, then pick the cheapest mode that meets it, and make sure something actually re-triggers the sync.

  • Two jobs both end with publish_table on the same online table; what goes wrong, and what is the fix?
    Only one sync per online table may run at a time, so the second call fails with an error saying the feature sync pipeline is already running. Databricks recommends a single `publish_table` task at the end of the workflow. If the workflows cannot be coordinated, call `get_status()` and wait for the running sync to finish before publishing again.
  • A feature table was published to a second online table to test a bigger store; why do endpoints still read the old one?
    When one feature table is published to several online tables, Model Serving and Feature Serving endpoints always resolve to the oldest online table by creation time. To move endpoints, follow the documented blue/green route: create the new store, publish to it, point new endpoints at it, validate, and then remove the old endpoints and store.

  • publish_table keeps the online store in sync automatically under its default mode.
  • CONTINUOUS is the default publish mode for Databricks online stores.
  • Change Data Feed is only needed for CONTINUOUS, not for TRIGGERED.
  • Overlapping publish_table calls queue up and run one after another.
  • Dropping the online table with SQL DROP TABLE removes its stored data.

Assumes the databricks-feature-engineering client 0.13 or later as documented on 2026-10-06; publish_mode replaced the older streaming flag (streaming=True maps to CONTINUOUS).