Loading patterns for streaming data

By Hatnest · Reviewed by Saurav Raj Joshi · Updated Nov 30, 2026

A streaming load pattern is the route events take from a source (Event Hubs, Kafka, IoT devices, a custom app) to a store you can query. In Fabric you choose the route by the destination you need and how much control you want over the processing.

Pattern 1: eventstream to a destination

An eventstream is the no-code path. You add a source, optionally some operators, and a destination, then publish. Two destinations matter for loading.

Eventhouse destination

There are two modes:

  • Direct ingestion sends events as they are, with no processing, to a table in the eventhouse. After publishing you configure the target table and mapping in the Get data experience.
  • Event processing before ingestion is used when you filter or aggregate first, or when the stream is a derived stream.

Choose an eventhouse when you want fast KQL queries over fresh events. If other engines (Warehouse, Lakehouse, notebooks, Direct Lake) also need the data, turn on OneLake availability for the database or a table. It exposes a Delta Lake copy. While it is on you cannot rename tables, change a column type, apply row-level security, or delete, truncate or purge data; turn it off first for those tasks.

Lakehouse destination

Events are written to a Delta table in JSON, Avro or CSV input format. Two advanced settings shape the files: Minimum rows (1 up to 2 million per file) and Maximum duration (1 minute up to 2 hours). Smaller values give fresher data and many small files; larger values give fewer, bigger files. The stream has schema enforcement against the table. Columns missing from an event are written as null, extra columns are dropped, and a schema that drifts from the first record can lose data, so the lakehouse is a poor target for change-data-capture feeds. The Live view offers an Optimize table in notebook shortcut that compacts the small files.

A timing trap: when you publish, ingestion and routing both start at "now", and ingestion can be faster. For eventhouse (with processing) and lakehouse destinations, untick Activate ingestion, publish, then activate with a custom start time so early events are not missed.

Pattern 2: Spark structured streaming

Use a notebook or Spark job definition when you need code-level logic: parsing, joins, stateful aggregation, or writing to several sinks. Spark treats the stream as a table that grows. The standard lakehouse shape is read stream, parse, write stream to Delta.

(spark.readStream.format("eventhubs").options(**ehConf).load()
  .withColumn("body", f.col("body").cast("string"))
  .select(f.from_json("body", schema).alias("e")).select("e.*")
  .writeStream.format("delta")
  .option("checkpointLocation", "Files/checkpoint")
  .outputMode("append")
  .trigger(processingTime="1 minute")
  .toTable("events"))

The checkpoint location is what makes the query restartable without losing or repeating data. The trigger controls cadence:

  • Processing time with "0 seconds" (or no trigger) runs the next microbatch as soon as the last ends: lowest latency, but many small writes.
  • A longer interval batches events into larger files.
  • availableNow=True processes everything currently available and stops. Use it for scheduled incremental jobs and backfills; reusing the same checkpoint continues where the last run ended.

To control file layout, enable Optimized Write (spark.databricks.delta.optimizeWrite.enabled) or use repartition() and partitionBy(). Queries launched with toTable() run asynchronously, so call awaitTermination() if the job must wait for them.

Choosing

Pick an eventstream with an eventhouse when you want near-real-time analytics with little code. Pick an eventstream with a lakehouse for simple persistence with tunable file size. Pick Spark when the load needs custom transformation, or when streaming semantics must run on a schedule.

Common mistakes

  • Omitting the checkpoint location.
  • Using the fastest trigger and then wondering why the table has thousands of tiny files.
  • Sending CDC records with changing schemas to a lakehouse destination.
  • Forgetting to await a streaming query in a scheduled notebook, so the job finishes early.

For the exam

  • Eventhouse destination: direct ingestion versus event processing before ingestion.
  • Lakehouse destination file size is tuned by minimum rows and maximum duration.
  • OneLake availability exposes eventhouse data as Delta, with limits while on.
  • Checkpoint plus trigger define a Spark streaming load; availableNow suits scheduled incremental runs.
  • Append is the usual output mode for ingestion into Delta.

Sources