DatabricksJerry Peng, Abhay Bothra, Sudhanva Huruli, Navneeth Nair, Anant Pingle, Murali TalluriAnnouncement
Announcing General Availability of Real-Time Mode for Spark Declarative Pipelines on Databricks
Summary
Databricks announced the general availability of Real-Time Mode (RTM) for Spark Declarative Pipelines (SDP), enabling low-latency streaming pipelines. RTM is an evolution of the Spark Structured Streaming engine that achieves millisecond-range latencies by streaming data continuously, running all query stages simultaneously, and passing data between stages as soon as it is produced. Benchmarked against Apache Flink on actual customer workloads performing feature computation, RTM was up to 92% faster, and it eliminates the need for separate specialized engines like Flink. To use RTM, users configure the pipeline in continuous mode, set spark.databricks.streaming.realTimeMode.enabled to true, and define an update flow with pipelines.trigger set to ‘RealTime’ targeting a sink. RTM on SDP supports operational use cases including fraud detection, live personalization, real-time recommendations, and real-time feature computation, with the Databricks Feature Store achieving end-to-end p99 latency of 200ms from Kafka to the online feature store.
Context
Databricks introduced Real-Time Mode last year to enable low-latency streaming with Spark, but customers still needed to maintain separate engines like Flink for operational use cases. Spark Declarative Pipelines (SDP) had become the standard for streaming and ETL pipelines, handling dependency resolution, incremental processing, orchestration, failure recovery, and data quality enforcement. With RTM now GA on SDP, customers can build operational low-latency pipelines using a single framework, eliminating duplicate codebases and fragmented governance.
Approach / What changed
To use RTM on SDP, set the pipeline mode to continuous and enable spark.databricks.streaming.realTimeMode.enabled. Define an update flow using the @dp.update_flow decorator with pipelines.trigger set to ‘RealTime’ and target pointing to a sink. For custom sinks like Lakebase or Redis, define a ForEach sink with a writer implementing open, process, and close, then register it as a foreach_sink and wire it to the update flow.
Takeaways
RTM achieves millisecond latencies by streaming data continuously and running all query stages simultaneously, passing data between stages as soon as it is produced.
In benchmarks on customer feature-computation workloads, RTM was up to 92% faster than Apache Flink.
RTM on SDP supports writing to any custom sink (e.g., Lakebase, Redis) using a ForEach sink, with features landing in the operational store within milliseconds without offline-to-online sync.
FAQ
How do I turn on real-time mode in a pipeline?
Set the pipeline to continuous mode and set spark.databricks.streaming.realTimeMode.enabled to true. Then define an update flow with pipelines.trigger set to 'RealTime' and a target that points to a sink.
Can a real-time pipeline write to Lakebase or another OLTP store?
Yes. Define a ForEach sink with a writer that implements open, process, and close, then point a real-time flow at it. This works for Lakebase, Redis, or any other OLTP store.
What use cases is Real-Time Mode in Spark Declarative Pipelines built for?
Real-Time Mode is built for operational workloads that turn streaming data into decisions in milliseconds. Examples include fraud detection, live personalization, real-time recommendations, and real-time feature computation. The Databricks feature store uses this architecture to reach a p99 latency of 200 ms from Apache Kafka to the online feature store.
Source and freshness
- Source
- databricks.com
- Published
- Added to Yomu
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.