Real-time fraud scoring on a payment stream
How we would design a scoring path that decides inside the authorisation window, falls back safely, and keeps training and inference features consistent.
Technical demonstration. Reference architecture written by Fuzzion. Not a client engagement; contains no outcome metrics.
Challenge
A payment provider must decide whether to approve each authorisation within a fixed time window. Rules alone produce too many false declines; a model alone is opaque to risk teams and fails closed when it is unavailable.
Constraints
- Hard latency ceiling set by the card network authorisation window.
- Risk analysts must be able to explain and override any decision.
- Features used in training must match those computed live.
- The scoring path must degrade to rules, not to declining everything.
Architecture
View as text
Payment events flow through a durable log into a stream processor that computes features and writes them to an online feature store. The scoring service combines model scores with deterministic rules in a decision engine that approves, routes to review, or declines. Review outcomes become labels for offline training, and the same feature definitions serve training and inference.
Components
- Payment events — authorisations
- Event log — partitioned
- Stream engine — windowed features
- Feature store — online · offline
- Scoring service — model · fallback
- Decision engine — rules + score
- Outcome — approve · review
- Analyst review — labels
- Training — versioned
Connections
- Payment events → Event log
- Event log → Stream engine
- Stream engine → Feature store
- Feature store → Scoring service
- Scoring service → Decision engine
- Decision engine → Outcome
- Outcome → Analyst review
- Analyst review → Training (labels)
- Training → Scoring service (new version)
Engineering approach
- 01
One feature definition, two paths
Windowed features are defined once and computed by the stream processor into an online store for inference and an offline store for training, eliminating training/serving skew by construction.
- 02
Score plus rules, not score instead of rules
The decision engine combines the model score with explicit rules analysts own. Every decision records which rules fired and the score band, so it can be explained.
- 03
Timeout budget with a defined fallback
The scoring call has its own timeout inside the authorisation budget. On timeout or error the engine decides on rules alone and flags the transaction for review.
- 04
Shadow, then canary
New model versions score live traffic in shadow mode, are compared against the current version, and only then take a small share of real decisions.
Technologies
- Kafka
- Apache Flink
- Redis
- PostgreSQL
- PyTorch
- Triton Inference Server
Operational considerations
- Consumer lag and feature freshness alerts, since stale features silently degrade decisions.
- Per-version decision distributions monitored for drift.
- Fallback rate is a first-class metric; a rising rate is an incident.
What we would measure
Success criteria we would agree before work starts. These are not results.
- Decision latency at p50 / p99 against the authorisation budget
- False-decline and missed-fraud rates from review labels
- Fallback-to-rules rate
- Review queue size and time-to-label