
Proposed design and demonstration. Not executed; no client results or compliance assurance claimed.
The engineering problem
A fast stream is not automatically a reliable decision input. Financial events can arrive late, be duplicated or reverse an earlier event. A pipeline must define how those conditions change a result before the result is used by an investigator or downstream system.
Design the data contract
Use fictional payment events with stable event IDs, event time, ingestion time and a reference to any reversal. Separate raw capture from validated events and task-specific projections. A fraud feature, a credit-risk view and a reporting aggregate may have different freshness and completeness requirements.
For a Kafka/Flink-style prototype, explicitly configure the tested event-time and replay behaviour rather than relying on a product label such as “exactly once.” Validate the boundaries between the broker, processor, state store and destination. This demo should produce investigation candidates, not make real credit decisions.
Proposed architecture

Proposed demonstration
- Generate labelled normal, duplicate, late and reversed events.
- Replay a fixed event set through a disposable stream.
- Interrupt processing and restart from the configured state.
- Compare final projections with an independently calculated expected result.
Use fictional records in a disposable environment. Record the source version, configuration, expected outputs and any limitations before executing the exercise.
What to measure
- End-to-end event delay
- Duplicate or missing output effects
- Reconciliation after restart
Keep failures in the results and compare repeated runs against a defined baseline. This first draft contains no executed benchmark or production result.
Evidence to keep
Report completeness and failure behaviour alongside latency. No fraud-detection effectiveness or credit-risk performance is claimed without separate model evaluation.
The next step is a reproducible implementation, sanitised screenshots and a measured validation record. Any regulatory applicability must be assessed for the institution, activity and jurisdiction; EU frameworks do not automatically apply to every New Zealand bank or insurer.
Worked example and design decisions
A payment event arrives twice, and its reversal arrives after the normal event-time window. A pipeline that counts both copies or discards the reversal can create an incorrect investigation signal and an unreconciled reporting position.
Use this scenario to write the expected result before building the pipeline or agent. Identify the exact source facts, the permitted transformations and the outcome that a reviewer should see. Keep the reference result independent of the implementation under test.
A concrete data or asset contract
The following is a proposed application contract, not an assertion that these are native vendor API fields. Adapt names and types to the selected platform while preserving their intended meaning.
| Proposed field | Meaning and implementation concern |
|---|---|
event_id | Stable event identity |
event_time | Time of the business occurrence |
ingested_at | Time the platform received it |
entity_ref | Synthetic account or payment reference |
reversal_of | Reference to an earlier event if relevant |
schema_version | Version used by the parser |
Document null semantics, stable identifiers and schema ownership with the contract. A missing observation, a zero amount and a denied lookup are different states and should not collapse into the same empty response.
Implementation blueprint
1. Preserve raw events
Retain immutable evidence within the agreed policy so a test run can be replayed. Keep source identity separate from transport offsets.
2. Define event-time policy
Specify ordering assumptions, lateness handling and the treatment of idle partitions for the tested implementation. Document what happens beyond the accepted lateness boundary.
3. Make destination writes deliberate
Define idempotency or transactional behaviour at the destination, not just within the processor. Confirm restart behaviour across the complete path.
4. Separate downstream projections
Investigation features and reporting aggregates can have different completeness windows. Publish their status and as-of time rather than implying one uniform notion of real time.
Failure analysis: test the uncomfortable case
The stream processor restarts correctly but the sink repeats an external side effect. Test the full producer-to-destination path and avoid claiming end-to-end exactly-once behaviour from one component setting.
Build this condition into the synthetic test set. Capture the observed output, the control that should detect the issue and the recovery decision. If the system returns a polished but unsupported result, record that as a failure rather than a successful request.
Operational ownership and runbook
Monitor consumer lag, late-event volume, rejected schemas and reconciliation differences. Keep a recovery procedure for replaying the affected range without duplicating downstream effects.
A useful incident record identifies the affected product or capability, the relevant run or request, the business time represented and the owner of the next action. Distinguish restoring infrastructure from restoring correct service output. Preserve enough versioned evidence to explain the recovered state.
Evidence required before a production claim
The core design controls for this topic are: Stable event IDs; explicit event-time behaviour; tested sink semantics; replay evidence; and independent reconciliation.
- Contract review: confirm field meaning, intended use, owner and access boundaries.
- Positive and negative tests: include the worked example, invalid inputs, restricted access and the failure case described above.
- Repeatable measurements: retain configuration, workload size, timing method, failures and the baseline used for comparison.
- Recovery evidence: demonstrate the documented recovery route and validate the resulting data or application behaviour.
This expanded article remains a proposed technical design. Environment-specific configuration, screenshots and measured outcomes should be added only after the implementation is executed and reviewed.
References and scope
References checked 29 October 2026. Sources provide context; the architecture and exercise are proposed editorial examples, not vendor-certified implementations.
