Part F · Chapter 31 · The platform on Azure, streaming and AI

31. Pipeline patterns: choosing and combining

Eight pipeline patterns, each with its own trade: ETL and ELT, event-at-a-time streaming and micro-batch, Lambda and Kappa, fan-out and event-driven handlers. Choose per workload by four questions (freshness, where the transformations belong, recovery and replay, delivery), then combine the patterns around one published event.

One claim event, four workloads, four patterns
Playback speed

The clip publishes the ClaimReported event once and follows it to Harbour Mutual's four workloads: the acknowledgement letters (an event-driven handler, ready in ten seconds), fraud scoring (a Kappa stream job, about half a minute), finance month-end (an ETL batch, readable at 10:05) and the search index (a five-minute micro-batch, about three minutes). Then the search index goes down and only search waits; two deliveries repeat and the letters handler posts each letter once; the fraud features change and only the fraud job is replayed.

The idea: a pattern per workload, combined around the event

The Theory section Pipeline patterns takes each pattern apart on the same ten claim events; this chapter puts them back together. Each pattern answers a different need:

  • ETL runs the rules before the target; ELT keeps the raw data and runs them in the platform.
  • Event-at-a-time streaming handles each event as it arrives, with state; micro-batch handles a stream in small batches, trading freshness for overhead.
  • Lambda keeps a batch of record beside a fast path, at the cost of two code paths; Kappa keeps one path and recomputes by replaying the log.
  • Fan-out gives one event to many independent consumers; event-driven handlers start work when a business event happens, and must be idempotent.

Choose by asking four questions in order: how fresh must it be; where do the transformations belong; how does it recover, and can it replay; how is it delivered downstream. Then combine: publish each business event once, and let each workload subscribe with its own pattern.

Remember Choose a pattern per workload by freshness, transformations, recovery and delivery; combine them around one event published once.

A worked example: one event, four workloads

The four questions asked of Harbour Mutual's workloads (computed by the engine)
WorkloadFreshnessTransformationsRecovery and replayDeliveryPattern
Claims notificationsMinutes: a micro-batch is fresh enough, and so is anything that streams.In a handler per event: there is nothing to aggregate, only one action to take for each claim.Never by replaying: a replay would send every letter again. A handler retries, and remembers what it has done.As an event routed to its handler, which must be idempotent because delivery can repeat.Event-driven
Fraud scoringSeconds: only processing each event as it arrives is fresh enough.In a stateful stream job: each score needs the customer's recent claims, kept as the job's state.Its logic changes and every score must be recomputed: keep the log and replay it through the new job.As one of several independent consumers of the same event: a fan-out, so its failure stops nobody else.Kappa architecture
Finance month-endA day is enough: a scheduled batch.Before the target: its readers cannot be kept out of a raw zone, so the rules run on the way in.The batch is the book of record: a failed load is run again from the source for the period.As one of several independent consumers of the same event: a fan-out, so its failure stops nobody else.ETL
Search indexMinutes: a micro-batch is fresh enough, and so is anything that streams.In small batches: the sink takes bulk writes, so events are grouped before they are written.From its checkpoint: the next batch reads on from the last committed offset, and a rebuild reads the log again.As one of several independent consumers of the same event: a fan-out, so its failure stops nobody else.Micro-batch

The search index's micro-batch every five minutes needs 5 batches for the morning's claims, 100 seconds of overhead, and a claim waits 3 min 17 s on average. The fraud job, if it ran as Lambda instead of Kappa, would keep 3 rules in two code paths (6 test suites).

A replay of the fraud job at full size, thirty days of the log read at 2,000 events a second while 1.4 a second keep arriving, takes about 30.0 minutes; and the letters handler, without a deduplication key, would post 12 letters for ten claims.

Try this In the Pipeline patterns lab, take the search index down and switch the consumers from isolated to coupled: watch fraud scoring stop with it.

Why it matters for Alex

Every team that touches claims will ask Alex for "real-time". Four questions turn that into four precise answers, each with a cost someone has agreed to: a nightly ETL for finance, a five-minute micro-batch for search, a replayable stream for fraud, an idempotent handler for letters. And one published event means a new workload is a new subscription, not a project.

Where it goes wrong

  • One pattern for everything. The monthly report runs on a stream nobody needed, or the fraud model waits for the nightly batch.
  • The open raw zone. ELT chosen, raw access never restricted.
  • Two code paths drifting. Lambda chosen for freshness, and the speed layer forgotten when a rule changes.
  • Consumers chained. One outage stops every team.
  • Handlers without a key. Customers receive their letters twice.

Exercises

The lab checks each one against facts written down in advance, so any answer the brief allows passes. A pass is kept in this browser.

Work the numbers

Compute each number from the morning's ten claim events, as the Theory pages do by hand. A small rounding difference is accepted.

batches
euros
letters
minutes

Which pattern is this?

Each line is a design note or a failure. Choose the pattern it belongs to.

A rule every reader of the target depends on runs before the load
The raw copy in the platform needs its own owner and restricted access
Each event is handled the moment it arrives; a burst leaves events waiting in the log
Each trigger pays a fixed cost, so a shorter interval costs more for the same events
The dashboard and the morning report disagree because one rule is written twice
A logic change reaches all history by reading the retained log from offset 0
The search index is down, but letters and fraud scores carry on
A letter is posted twice because the event was delivered twice

Which pattern carries the workload

Which pipeline pattern fits this workload? Pass all 8 situations to complete it.

Post the customer an acknowledgement letter within five minutes of reporting a claim, exactly one per claim. The broker delivers at least once.

Your choice
Your reason (one or two)

On Azure

Checked against Microsoft's documentation on 24 October 2026.

One way to build the combined design on Azure:

  • Azure Event Hubs keeps the ClaimReported events (up to 7 days on Standard, 90 on Premium and Dedicated); each workload reads through its own consumer group (20 per event hub on Standard, 100 on Premium), and Event Hubs Capture writes the events to the lake.
  • Azure Functions handles the letters; its Event Hubs trigger delivers at least once, so the handler deduplicates on the event id.
  • Azure Databricks Structured Streaming runs the fraud job (replayed with a new checkpoint from the earliest offset) and the search index's micro-batch with a processingTime trigger.
  • Azure Data Factory runs finance's ETL on a schedule, with mapping data flows for the transformations.
  • Where a broker must deliver to subscribers with retries and dead-lettering, Azure Service Bus topics (a dead-letter queue per subscription) or Azure Event Grid (at least once, dead-lettering to storage) fit.

Take it to work

Pipeline pattern choice

Choose and combine pipeline patterns for the workloads on one event.

The event

  • Which business event, its id and its schema
  • Where it is published and how long it is kept

Each workload

  • How fresh it must be
  • Where its transformations belong
  • How it recovers, and whether it may be replayed

The pattern

  • The pattern chosen per workload, and the reason

Delivery

  • Its subscription, its dead-letter queue and their owner
  • Its deduplication key, if it acts on each event

Costs accepted

  • Overhead, second code paths, retention and replay time

Tools in this chapter

  • Pipeline patterns lab · Run the same claim events through eight pipeline patterns and see latency, overhead, a consumer failing, a delivery repeated and a logic change replayed.
  • Stream lab · Run one claims feed as batch, Lambda and Kappa side by side, inject a late correction and replay the log.

Terms taught here: ETLELTRaw zoneMicro-batchFan-outEvent-driven

An unhandled error has occurred. Reload 🗙

Reconnecting…

Your connection to the Cloud Data Architecture Lab dropped, probably a Wi-Fi blip. Hold on while it reconnects.

The connection could not be restored. The page will reload in a few seconds.