Essay · 15 Nov 2026

Real-time mode is a good start, until the job gets complex

Databricks real-time mode is an easy first step into streaming for an ETRM estate. Complexity, not latency, decides when Flink is worth a second platform.

Databricks real-time mode turns a Spark Structured Streaming job into one that processes each record as it arrives, and it does so with a cluster setting and a trigger. I have been experimenting with it on the latest Databricks runtime. It was easy to set up and easy to understand.

I have also been working with Apache Flink and Apache Fluss, both as open-source Flink and through a vendor. Flink does more, and it is a second platform to buy, run and staff. I think real-time mode is promising and a good place to start, and that complex scenarios and setups may find it limited. Complexity, not latency, is the dividing line, and the choice comes down to a decision about commercial investment.

In November 2026 the current releases are Databricks Runtime 19, Flink 2.3 and Fluss 1.0. Real-time mode gained operators in Runtime 18 LTS and again in 19, and I expect these gaps to narrow.

§1A setting and a trigger, on conditions

The setup is short. Turn real-time mode on in the cluster's Spark configuration, write in update mode and swap the trigger for the real-time one. The query is otherwise the DataFrame code a Spark team already writes.

The conditions are on the cluster and on the job's two ends. The cluster is classic compute with autoscaling, Photon and spot instances turned off. It is sized so that every task in every stage has a slot, and it runs one real-time job. Records come in from Kafka, Event Hubs or Kinesis and go out to Kafka, Event Hubs or a foreach writer. A job that writes Delta tables or uses foreachBatch has to be redesigned before its trigger can change.

§2Long batches against continuous operators

Micro-batch, Spark's usual streaming mode, collects the records that have arrived, runs them as a small batch and records its progress before and after. That bookkeeping is the floor under its latency. Real-time mode keeps the batch but makes it long, 5 minutes by default, and processes records inside it as they arrive. Every stage of the query is scheduled at once and the stages pass records to each other through a streaming shuffle. Progress is checkpointed between batches, so a failure replays from the last checkpoint.

Because every stage runs at once, each holds its task slots whether or not records are flowing. The cluster is fixed in size, and Databricks' documentation recommends micro-batch where sub-second latency isn't needed, because real-time mode needs dedicated compute.

A Flink streaming job has no batch boundary. It is a graph of operators that run continuously and pass records between them. Each operator keeps state per key and can set timers on it, and Flink snapshots that state while the job runs. Real-time mode supports the operators Databricks has so far adapted to its long batch, and Flink's list is longer.

The table sets six jobs that an energy trading and risk management (ETRM) estate asks of a streaming engine against both.

JobReal-time mode, Runtime 19Flink 2.3 with Fluss 1.0
Keep a position current through amendmentsAggregates and transformWithState; two stateful steps in a row need Runtime 19State per key; SQL changelogs retract the old value
Alert on a limitBroadcast join to a table of 10 MB or less; alerts out to KafkaLookup and temporal joins against reference data
Join positions to pricesInner join of two streams from Runtime 18 LTS, with extra configuration; no outer joinsRegular, interval, temporal and lookup joins
Notice what has not arrived by a deadlinePrompt timers in direct queries; in Lakeflow pipelines, timers wait for the batch end when no data arrives and event-time timers are listed as unsupported; no session windows or built-in pattern matchingTimers, session windows and pattern matching
Give the result somewhere to liveKafka, Event Hubs or a foreach writer; not DeltaA Fluss table tiered to the lakehouse, on its own cluster
Change a job that holds stateCheckpoint survives filter and trigger changes; not new grouping keys, aggregates or join typesSavepoints carry state to a new version or parallelism
Table 1Real-time mode covers positions, alerts and inner joins. Flink adds temporal joins, session windows, pattern matching and savepoints.

§3Positions and alerts fit

Take the illustrative trade from The users just see tables: a power trade booked at 100 MWh and amended that afternoon to 120 MWh. A position job has to take the 100 out and put the 120 in, so it must remember the last version of every trade. In real-time mode that can be state held per key with transformWithState, followed by a sum by book and delivery period, and two stateful steps in a row need Runtime 19. In Flink SQL the same job is a query over a changelog, and the engine retracts the old row itself.

Limit alerts fit better still. Each position update is compared with a limit and a breach is written to a topic, which is the Kafka-in, Kafka-out shape real-time mode starts from. The limits join as a broadcast table of 10 MB or less. Coinbase and DraftKings, two customers Databricks names, use real-time mode to compute fraud and risk features.

§4Price joins and event patterns are where it narrows

Valuing a position intraday means joining it to prices that are also moving. Real-time mode joins two streams from Runtime 18 LTS, with extra configuration, as an inner join only. An outer join, which would keep a position that has no price yet, isn't supported. Flink offers regular, interval, temporal and lookup joins. A temporal join gives each position the price that applied at its own event time.

The fourth job is noticing absence: a confirmation that hasn't come back, or a curve that hasn't been published by its cut-off. A timer set per key covers a cut-off, and real-time mode has timers. transformWithState supports processing-time timers, which on Runtime 19 fire close to their scheduled time, and Runtime 19 added event-time timers. The documentation for Lakeflow Spark Declarative Pipelines lists event-time timers as unsupported, and says a processing-time timer fires at the end of the batch when no data has arrived.

The gaps are session windows and matching a pattern across a sequence of events. Real-time mode has neither built in. Flink has both, with pattern matching in code or in SQL with MATCH_RECOGNIZE.

§5The result still needs a table

Real-time mode doesn't read or write Delta. The position it computes lands on a topic or goes through a foreach writer, and the earlier essay's problem returns. A report wants a table that is current and keeps its history, so the team builds a serving store for one and a lakehouse path for the other. Databricks' own energy trading architecture has real-time mode feeding its Lakebase database. The pipelines announcement says that write goes through the foreach sink today, with a native sink to come.

Flink with Fluss answers with one table that is current, carries its changelog and tiers to the lakehouse. The price is the cluster the earlier essay describes, with ZooKeeper and a tiering job. Among vendors, Ververica offers its Flink platform as bring-your-own-cloud or self-managed, and its Fluss is in private preview on the self-managed platform.

Databricks has a third option. Micro-batch writes Delta directly, and where a result that is seconds old will do, it is the simplest design of the three. From Runtime 16.4 LTS, real-time queries use a checkpoint format that lets a query whose source and sink both modes support switch between them. Apache Spark's documentation adds that a micro-batch query on the older format starts from a new checkpoint.

§6A position job has to survive its own changes

A position job is long-lived and its logic changes. Flink's savepoints are built for that: stop the job, deploy a new version or a different parallelism, and resume with the state mapped to operators by ID. The discipline is paid up front. Every operator needs a stable ID, and the maximum parallelism is fixed for the life of the state.

On Databricks, a checkpoint survives a change to a filter, a trigger or a rate limit. It doesn't survive a change to grouping keys, aggregates or the type of a join; those start again from a new checkpoint. transformWithState is more forgiving, since with Avro encoding its state can gain and lose fields. I would settle how a stateful job is going to be changed before choosing the engine it runs on.

§7The public latency figures tie on simple jobs

Databricks' benchmark runs 10,000 rows a second from Kafka to Kafka against Flink 1.18 on Amazon Managed Service for Apache Flink. Its 99th-percentile latencies are 3 ms for both engines on a stateless query, 14 ms against Flink's 45 ms on an aggregation, and 9 ms against 95 ms on a join to a static table. It takes Spark's worst run and Flink's best, which favours Flink. It doesn't give the size of either cluster, and the join compares a Spark broadcast with Flink reading Parquet from S3. The customers Databricks names report more: Coinbase under 100 ms at the 99th percentile, and MakeMyTrip a 44 ms median with about 500 ms at the 99th, as Kai Waehner notes.

Francisco Morillo has published a benchmark on open-source Spark, not Databricks.1 A Kafka-to-Kafka JSON filter at about 100,000 events a second, with the stateful runs at 50,000, on Amazon EKS, with 7 cores and 14 GB for each engine and checkpoints to S3 every 60 seconds. The first round used Spark 4.1.2 and Flink 2.2.0. On Spark 4.1 his stateless job tied at a median of about 6 ms, while Spark's 99th percentile ran to several hundred milliseconds against Flink's tens. His second round, on Spark 4.3 and Flink 2.3, has the stateless job at about 30 ms for Spark against 27 ms for Flink at the 99th percentile.

The gaps moved to jobs that do more. On a stateful job both tails ran to seconds and Flink's was the shorter. On a join against a static table, Spark's 99th percentile was about 275 ms against Flink's 20 ms.

The two benchmarks disagree about which engine is faster once a job holds state or joins. On a simple job the public figures give no reason to choose either engine. I think the dividing line is complexity: whether the job needs something from the right-hand column of the table.

§8A second platform is an investment decision

Flink's costs are of a different kind from real-time mode's limits. It is a second platform with its own cluster. Its state tuning depends heavily on memory and configuration, and its APIs are Java first. Its newer disaggregated state is still experimental in 2.3, and Flink's documentation lists no Kafka connector release for 2.3 yet. On Azure, Microsoft retired its preview Flink service in January 2025, so Flink there is run by the team or supplied by a vendor.

An estate that already pays for Databricks can start without any of that. A position kept current, a limit alert and results on a topic need no new platform, the skills are ones a Spark team has, and micro-batch covers whatever can wait a few seconds. For an estate moving off scheduled extract, transform and load (ETL) jobs, that is a first step it can take now.

So I think real-time mode is promising, and a good place for an estate on Databricks to start. Complex scenarios and setups may find it limited today: sessions and event patterns, price joins that must keep unmatched rows, results that have to be a table and state that must survive a redesign. When those arrive, the choice is whether the scenario is worth a second platform, and that comes down to a decision about commercial investment.

Notes

  1. A Kafka-to-Kafka JSON filter at about 100,000 events a second, with the stateful runs at 50,000, on Amazon EKS, with 7 cores and 14 GB for each engine and checkpoints to S3 every 60 seconds. The first round used Spark 4.1.2 and Flink 2.2.0.
Cite this

BibTeX

@misc{morris2026real,
  author       = {Morris, Gary},
  title        = {{Real-time mode is a good start, until the job gets complex}},
  year         = {2026},
  month        = nov,
  howpublished = {\url{https://cognerys.com/writing/real-time-mode-until-the-scenario-gets-complex}}
}

APA

Morris, G. (2026, November 15). Real-time mode is a good start, until the job gets complex. Cognerys. https://cognerys.com/writing/real-time-mode-until-the-scenario-gets-complex

Gary Morris

Founder, Cognerys · PhD Candidate, University of Bath

Gary Morris founded Cognerys after a decade in energy trading technology, working across platform engineering, data systems and solution architecture. About

Cognerys works with energy trading firms on questions like this. Related service: Architecture and transition review. gary@cognerys.com