Durable Logs, Queues and Stream Processing

Data infrastructure is a set of ordering, ownership, state and replay contracts. The same event can be durably stored yet still be lost, duplicated or misapplied at an external effect boundary.

Section 7 of 9 · 15 units · about 64 hours

0/15

By the end you can Preserve the stated ordering and effect semantics across producer and consumer retries, rebalance, crash and replay, then recover matching offsets, state and outputs while handling late data under an explicit event-time policy.

Units

Build it

Mini project · about 16 to 22 hours

Replayable partition logs and checkpointed event-time effects

Extend loglab from partitioned storage and workflows into a bounded log and stream processor. Run local processes on your machine, establishing replay and effect correctness before measuring lag, recovery and overload.

  1. 1Extend storage/ and stream/ with segmented partition logs, sparse indexes, retention and compaction. Check recovery against an acknowledged-prefix oracle at append and manifest-publication boundaries, retain corruption verdicts, and pass Gossip Glomers 5a through a separate adapter without claiming it tests disk durability.
  2. 2Connect replica/ or consensus/ to an explicit high watermark and durable producer identity, epoch and sequence state. Compare failover, duplicate retries and timeout-after-commit histories with a sequential append model; retain visibility and acknowledgement verdicts with deliberate Kafka contract differences.
  3. 3Implement durable group positions and epoch-fenced reassignment in stream/, using the txn/ effect boundary. Check kill-and-reassign, contiguous commits and each effect-versus-progress crash window against an independent sink ledger; retain dedup TTL expiry and restart tests, explicitly excluding nonparticipating external effects.
  4. 4Build CDC replay with per-partition source positions, per-key versions and retained tombstones. Check out-of-order and cross-partition arrivals, mixed reader-writer schemas and snapshot-plus-position restarts against a full-fold oracle; retain snapshot publication crash tests and state which cross-partition orders the contract excludes.
  5. 5Build a keyed shuffle and event-time window processor with explicit triggers, accumulation, minimum-input watermarks, idleness and drop-versus-correction policies. Compare scripted late-event histories with a batch oracle under the same policy; retain hot-key routing, horizon expiry and bounded-state evidence.
  6. 6Align checkpoint barriers over FIFO logical channels above net/, snapshotting offsets, keyed state and the participating sink boundary together. Inject mid-window kills and offset-state mismatches, compare restored replay with uninterrupted oracle outputs, and retain partial-checkpoint rejection plus immutable snapshot-pointer restore tests.
  7. 7Wire bounded retries, durable dead letters, backpressure and retention-lag alerts; first check poison-record and storage-full schedules against a queue model. Then repeat matched open-loop runs and Gossip Glomers 5c, retaining versions, workloads, raw lag, goodput, duplicates, rebalance pauses, checkpoint costs, drain and recovery distributions.
What you hand in
  • The integrated stream/ data path with durable producer and group state, bounded windows, dead letters and checkpoint recovery.
  • Reference models, deterministic fault schedules and raw histories covering visibility, delivery, CDC, shuffle and snapshot publication.
  • A contract and measurement report with Kafka deviations, matched repeated runs, retention bounds and recovery evidence.
How to check it
How it's graded

Log visibility and identity

Pass: Your prefix and append-model tests check recovery, committed visibility, failover and retry suppression across producer restart; public histories pass within their narrower scope.

Great: A planted premature acknowledgement or lost producer-state bug fails before repair; a minimized history explains the exact durability or retention boundary.

Ownership and effect scope

Pass: Your independent sink ledger verifies epoch-fenced reassignment, contiguous positions and crash-window replay. TTL expiry tests bound duplicate suppression, and external effects remain explicitly outside the atomic claim.

Great: Delayed stale commits and timeout-after-effect retries expose a naive implementation; retained regressions distinguish harmless redelivery from duplicated effects.

Replay and checkpoint agreement

Pass: Full-fold and batch references match CDC and window outputs under declared ordering and lateness policies. Your restore tests catch offset-state mismatch, partial publication and stale tombstone resurrection.

Great: The same logical input rebuilds matching state through both retained-log replay and snapshot-plus-suffix recovery, including skew, idle inputs and late corrections.

Bounded operation evidence

Pass: Your queue-model tests precede load. Repeated matched runs retain raw lag, goodput, duplicates, checkpoint cost, rebalance, drain and catch-up evidence with versions and settings.

Great: A losing batching or checkpoint policy remains in the report, with causal traces explaining its resource and recovery trade-off rather than a universal performance claim.

Resources