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

29. Integration patterns: batch, streaming, APIs and sharing

Data moves between systems in five ways: a batch file, change data capture, an event stream, an API call, or not at all, shared in place. Each is fresh to a different degree, costs differently and fails differently; the flow's needs decide.

One claim event delivered four ways, with latency and cost
Playback speed

The clip follows one claim reported at 10:14. By event stream, the fraud model sees it seconds later; by change data capture, about five minutes later; by API, whenever someone asks; by the nightly file, at 02:00 the next day. Each lane shows its illustrative daily cost, then how it fails: a late file loses a day, a capture that falls behind loses changes, a stream consumer catches up from its offset, an API fails every caller at once. Last, the reinsurer reads the large losses in place, with nothing copied.

The idea: five patterns, chosen by the flow

  • Batch: a file or extract on a schedule. Simple and cheap; as fresh as the last run.
  • Change data capture (CDC): read the source database's change log and send every insert, update and delete. Minutes fresh, every change, and the source system does not change.
  • Event stream: the source publishes an event for each thing that happens; consumers read the log at their own pace and can replay it. Seconds fresh, but the source must publish events.
  • API: the consumer asks for one record when it needs it. Always current, nothing copied, but nothing kept either, and the source must be up.
  • Sharing in place: the consumer reads your table where it is, through a share you can revoke. No copy, no pipeline.

Choose by the flow's facts: how fresh it must be, whether it needs every change or only the state, whether the consumer looks one record up, whether the data may leave, and what the source can offer (events, a readable change log, or only a file).

Remember Fresher costs more and fails differently: give each flow the simplest pattern that meets its needs, and share in place when the data may not be copied.

A worked example: six flows after the merger

The six flows and the pattern that fits each (computed from the flows' facts)
FlowPattern
Claims system to the fraud model: every new claim scored within a minute of first notice. The claims system publishes an event for each claim.Event stream
Policy administration to silver: every change, deletes included, within 15 minutes. The system publishes no events; its database change log can be read.Change data capture
Finance ledger to the board pack: the month's closed figures. The finance team allows only a nightly export file.Nightly file
Broker portal to policy administration: is this customer's policy active, asked once per quote while the broker waits.API call
Gold to the reinsurer: the quarter's large losses, read in the reinsurer's own platform, never copied out of Harbour Mutual's.Sharing in place
Kestrel's claims database to Harbour Mutual's lakehouse during the merger: every change, within the hour. Kestrel publishes no events; its change log can be read.Change data capture

The nightly claims extract is a batch pattern at its simplest: everything reported since the last load, 2026-05-11, read with a high-water mark. On the seed it finds 8 claims.

The nightly extract: claims reported since the last load (PostgreSQL)
SELECT claim_number, policy_id, loss_date, reported_date, cause, status, reserve
FROM claims
WHERE reported_date > DATE '2026-05-11'
ORDER BY reported_date, claim_number
The five patterns side by side (illustrative daily cost units)
PatternSeen afterEvery changeOn demandNo copyCost a day
Nightly file24 hnonono1
Change data capture5 minyesnono3
Event stream3 syesnono4
API call0.6 snoyesno2
Sharing in place0nonoyes0.5
Try this In the Stream lab, compare the nightly batch with the streaming views: the batch is always right, but only once a day.

Why it matters for Alex

Every flow on the merged map will be argued about: the fraud team wants everything in real time, the finance team wants a file it can check, the reinsurer wants a copy it is not allowed to keep. Choosing by the flow's facts gives each the pattern it needs, and a reason Alex can give the board and the engineers alike.

Where it goes wrong

  • Real time for everything. Streams built for monthly figures: more to run and more to fail, for nobody's benefit.
  • Nightly files for fraud. A claim scored the next morning has already been paid.
  • APIs as a data pipeline. Calling an API millions of times to copy a table: slow, fragile, and the source team's outage becomes yours.
  • Copies sent outside. Every file sent to a partner is a copy nobody can withdraw; share in place where you can.

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.

The right pattern for six flows

Choose a pattern for each of the brief's flows.

Claims system to the fraud model: every new claim scored within a minute of first notice. The claims system publishes an event for each claim.
Policy administration to silver: every change, deletes included, within 15 minutes. The system publishes no events; its database change log can be read.
Finance ledger to the board pack: the month's closed figures. The finance team allows only a nightly export file.
Broker portal to policy administration: is this customer's policy active, asked once per quote while the broker waits.
Gold to the reinsurer: the quarter's large losses, read in the reinsurer's own platform, never copied out of Harbour Mutual's.
Kestrel's claims database to Harbour Mutual's lakehouse during the merger: every change, within the hour. Kestrel publishes no events; its change log can be read.

How does it recover?

Each pattern fails in its own way. Choose the recovery for each failure.

The file arrives late or half-written: the whole day is missing or wrong.
The capture falls behind longer than the database keeps its change log: changes are lost.
A consumer is down for an hour: it misses nothing, but falls behind.
The source system is down: every caller fails at once.
The provider changes the shared table's columns: the recipient's queries break.

Share or copy?

Choose whether each request is served by sharing in place or by sending a copy.

The reinsurer reads the quarter's large losses in its own Databricks, and may not keep a copy
The external auditor checks this year's claims payments from their own tools, read-only, until the audit ends
Kestrel's analysts read Harbour Mutual's gold tables in Fabric during the merger
The supervisor's portal takes a file upload, and the file is theirs to keep
A broker builds its own commission tables from its policies and keeps them

On Azure

Checked against Microsoft's documentation on 18 October 2026.

Each pattern has an Azure form:

  • Batch: Azure Data Factory or Fabric Data Factory pipelines, with copy activities and incremental loads by a high-water mark.
  • Change data capture: Fabric mirroring keeps a near real-time copy of Azure SQL Database, Azure Cosmos DB, Snowflake and other sources in OneLake; Data Factory's change data capture and Databricks' Lakeflow Connect read source change logs too.
  • Event streams: Azure Event Hubs, which also speaks the Kafka protocol; Fabric Eventstream routes events into OneLake and Eventhouse; Databricks reads Event Hubs with Structured Streaming.
  • APIs: Azure API Management in front of the system's API, with keys, throttling and logs.
  • Sharing in place: Delta Sharing from Azure Databricks (open protocol, any recipient), Fabric's external data sharing between tenants, and OneLake shortcuts inside one.

Write each flow's pattern on the information map's flows (chapter 3), so the map says how the data moves as well as where.

Take it to work

Integration pattern choice

Choose and justify the pattern for each flow.

The flow

  • Source, consumer, what is moved

Its facts

  • Freshness needed
  • Every change or the state
  • A lookup on demand?
  • May the data be copied?
  • What the source offers

The pattern

  • Batch, CDC, stream, API or sharing, and why

Failure

  • How it fails, and how it recovers

Tools in this chapter

  • 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: Change data captureBatchEvent streaming

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.