Spark Ditches Dual Engines for Real-Time Mode

Databricks' new Real-Time Mode for Spark aims to deliver sub-second streaming speeds, eliminating the need for separate processing engines.

3 min read
Databricks logo and text announcing Spark Real-Time Mode
Image credit: StartupHub.ai

The era of juggling separate systems for batch analytics and real-time data processing may be over. Databricks has unveiled Spark Real-Time Mode, a significant evolution for Apache Spark Structured Streaming designed to deliver ultra-low latency directly within the Spark ecosystem. This move aims to eliminate the need for specialized engines like Apache Flink for mission-critical, low-latency applications.

Historically, achieving sub-second latency for use cases such as fraud detection, personalization, and real-time alerting meant adopting a complex, multi-engine architecture. This fragmentation led to duplicated codebases, separate governance models, and the need for specialized expertise. Spark Real-Time Mode, now in public preview, fundamentally re-architects the Spark execution engine to process events in milliseconds, directly addressing these long-standing operational challenges.

Performance Under Pressure

Databricks claims Spark Real-Time Mode can achieve latencies competitive with dedicated streaming frameworks, even outperforming Apache Flink in specific real-time feature computation benchmarks. These tests, simulating common workloads like feature enrichment via joins and aggregations, highlight performance gains attributed to continuous data flow, pipeline scheduling, and a new streaming shuffle mechanism.

This architectural shift allows Spark to handle demanding operational use cases without the overhead of maintaining disparate systems. The ability to process data as it arrives, rather than in discrete chunks, is key to achieving this speed. This marks a significant step forward for applications requiring immediate data insights, akin to the advancements seen in ultra-low latency streaming.

Simplifying the Real-Time Stack

Beyond raw speed, the primary advantage of Spark Real-Time Mode lies in architectural simplification. It eliminates "logic drift" by allowing teams to use the same Spark API for both batch training and real-time inference, preventing discrepancies between models and live data. This unification is crucial for real-time machine learning applications.

Furthermore, the mode offers flexibility. Teams can easily pivot between batch processing (e.g., daily or hourly triggers) and continuous, sub-second streaming with a single code change. This adaptability streamlines development and reduces the operational burden, enabling faster iteration on real-time applications, much like how unified pipelines are sought after for sub-second latency data processing.

Real-World Adoption

Early adopters are already leveraging Spark Real-Time Mode for critical applications. A digital asset platform uses it for fraud detection, updating feature stores in under 200 milliseconds. An e-commerce company employs it for real-time intent features to refresh recommendations instantly. DraftKings, a major sports betting operator, reports significant improvements in latency and pipeline design for their fraud detection models, enabling unified feature pipelines for ML training and online inference.

The introduction of Real-Time Mode Spark signifies a move toward unified data processing, promising to reduce operational complexity and accelerate the delivery of real-time applications without compromising performance.