Tools

Stream lab

One claims feed, three architectures. Read the log event by event as a nightly batch, as Lambda (a speed layer and a batch layer) and as Kappa (one streaming job over a log you can replay), then inject a late correction and see latency, cost and which views agree.

Window
Allowed lateness
What happens
Each architecture before and after the nightly batch at 23:00. Cost is in illustrative compute units: a streaming job all day is 24, a batch run 4, each event read 0.1.
ArchitectureMinutes until a claim showsWindows right before the batch Windows right after itEvents readCostCode paths
Batch 808 0 of 4 4 of 4 12 5.2 1
Lambda 1 3 of 4 4 of 4 24 30.4 2
Kappa 1 4 of 4 4 of 4 12 25.2 1
Playback speed

Windows are by event time, when the claim happened. A streaming job keeps a window open until its watermark, the latest event time it has seen less the allowed lateness, passes the window's end; anything that arrives for a closed window is dropped. The nightly batch reads the whole log, so it is always right, but only once a day.

Try this

0 of 4 done

Press Play and watch C-103's correction arrive at 09:56.

Look for: The stream jobs closed 09:00–09:15 long before: Lambda's speed layer and Kappa drop it and disagree with the truth.

Switch on the replay.

Look for: Kappa reads the log again and agrees with the truth before the nightly batch, at the cost of every event processed twice.

Set the allowed lateness to 60 minutes.

Look for: Every stream view takes the correction at once; the price is windows that stay open, and keep changing, for an hour.

With 60 minutes of lateness, switch on the speed layer's lagging code.

Look for: Lambda's speed layer counts C-103 twice until the batch layer overwrites it at night: the drift Kappa avoids.

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.