131,181keys matched the batch path exactly in every fault experiment
4.83Mreal GitHub events processed, 1–24 Nov 2026
271 → 23 ms7-day aggregate with a partial covering index (identical results)
48tests passing; CI green on all four jobs
Measured on one laptop with a replay of archived data, not real-time production traffic.
In short
I built a batch and streaming data pipeline over 4.83M real GitHub events, then killed consumers, froze the database and restarted the broker to prove the streamed results still match the batch path key by key.
Read the full overview
Public event data can't be trusted blindly: capture rates swing, GitHub changed its Events API payload in October 2025, and duplicates and malformed records arrive. repostream reads 4.83M real GitHub events (GH Archive, 1 to 24 November 2026) into a checked batch path (Parquet and DuckDB) and a streaming path (Redpanda into Postgres), then reconciles the two key by key. Seven fault-injection experiments on a replayed day showed the streamed results matched the batch path exactly on all 131,181 keys every time. It runs locally on one laptop, has no users and is not deployed; the cloud design is Terraform that has been validated but never applied. Built by me with AI coding agents.
The problem
A pipeline that looks right on a good day can still double count, drop events or freeze its own alarms when something breaks.
1
GH Archive captures a small, varying share of GitHub, so absolute numbers mean little and trends need care.
2
GitHub changed the Events API payload in October 2025; a metric silently went to zero.
3
Streaming systems redeliver, reorder and stall; the results have to stay right anyway.
My part
What I did
Architecture and the raw, silver and gold layers
The streaming consumers and the idempotent Postgres sink
The seven fault-injection experiments and the reconcile step
Prometheus alerts, Grafana dashboard and runbooks
The forecasting monitor with conformal intervals
CI, the hardened image and the Terraform design
Not mine
The data: GH Archive, a public archive of GitHub events
A real deployment, users or traffic: none exist
Solo, with AI coding agents: architecture, pipeline, streaming sink, experiments, monitoring, ML monitor and CI · Solo · 2026-11 – 2026-11
Hard parts
1Effectively-once results while things breakConsumers crash mid-batch and the broker redelivers; a naive sink double counts.
What I weighed
Exactly-once delivery from the broker
An idempotent sink keyed by event, checked by reconciling against the batch path
What I did
Each batch is written with key-ordered, conflict-free inserts and committed before its offsets, so a redelivered batch adds nothing.
The cost
Results are exactly-once; delivery is not, so the sink does the work.
How I checked
Seven fault experiments, each reconciled key by key against the batch path.
Result
Exact match on all 131,181 keys in every run (the poison run differs only by the 1,483 replaced messages, all dead-lettered).
2Monitoring that went blindDuring a 45 s database freeze, the consumer's self-reported lag froze with it, so no alert fired.
What I weighed
Trust the consumer's own metrics
Measure from outside: broker lag and stalled commits
What I did
Alerts now read broker lag sampled every 5 s and a stalled-commit signal; the SLO rule only evaluates while events flow.
The cost
More alert rules to maintain.
How I checked
Alerts tested against injected faults; three blind spots found and fixed.
Result
The freeze now fires ConsumerStalled at 44.9 s and ConsumerLagHigh at 59.1 s.
Screens
The Postgres-freeze experiment, recorded live in Grafana.
Indexes chosen from the access patterns, measured before and after.
Testing
48 tests (40 unit, 8 integration against Postgres) and seven fault experiments on a replayed real day.
0.5 msPostgres lookups at p50 after access-pattern indexes (from 11–250 ms)
19 sto validate and normalise 4.83M events on 6 cores (81 s single-process)
0fixable HIGH or CRITICAL findings in the hardened image (Trivy)
Bugs the tests found
A per-worker watermark raised 1,461 false late flags (fixed with a per-partition minimum); a property test found a parser crash; an integration test found an insert deadlock with 8 concurrent writers (fixed by key-ordered inserts).
A model that lost, reported as such
A gradient-boosted forecaster lost to a persistence baseline.
More
The monitor keeps persistence with split-conformal intervals: 89% coverage of a 90% target and 90% of injected 30% drops caught at a 6.6% false-alarm rate (synthetic drops, 111 test hours).
What I learned
What worked
Reconciling the stream against the batch path turns correctness into a number you can check after every fault.
What I underestimated
How easily monitoring goes blind when it measures from inside the thing that failed.
What I’d do next
Apply the Terraform design to a real cloud account only with an approved budget.
Re-run the experiments at higher rates on more than one machine.