Real-time processing
Real-time processing handles each event, such as a payment or a transaction, as soon as it arrives and returns a result within a response time set by the use case, instead of collecting events for a scheduled batch run. Instant payments and live fraud scoring are built on it.
What it is
Real-time processing is a way of running a system in which each input, such as a payment instruction or a market message, is processed the moment it arrives, and the result is returned within a response time fixed by the use case, usually seconds or less. Batch processing does the opposite: it collects inputs and processes them together at scheduled times.
A real-time flow has five parts:
- The event source, which produces each message as it happens.
- The processing steps, such as validation, a rules check or a scoring model.
- The response, the decision or posted result sent back.
- The latency target, the longest time allowed between arrival and result.
- The availability requirement, because events can arrive at any hour.
End-to-end latency is the sum of its steps: L = t_validate + t_score + t_post + t_network, where each symbol is the time spent in one step. A worker that needs p seconds per event handles at most 1 / p events per second, and a higher arrival rate builds a queue.
The ECB describes the Eurosystem’s instant payment settlement service as settling in real time, in central bank money, around the clock every day.
Why it matters
Some products are defined by their response time: an instant payment that waits for a batch run is no longer instant. The ECB notes that an instant payment can only be made when the payment service providers of both payer and beneficiary are able to process instant payments, so each side needs systems that answer without waiting for a cut-off.
Controls move with the flow. The ECB notes that instant payments, like other payments, may be subject to fraud. A check that runs after a batch finds the problem once the money has left, so screening and scoring sit inside the flow and decide before release.
Monitoring changes too: positions and queues are visible during the day only if data feeds update as events occur.
Worked example
Illustrative numbers. A payment service promises a result within 5 seconds. The steps take 0.2 seconds for validation, 0.3 seconds for fraud scoring, 0.5 seconds for posting and 0.4 seconds for network transfer. Total latency is 0.2 + 0.3 + 0.5 + 0.4 = 1.4 seconds, which leaves 3.6 seconds of margin.
A batch that runs once an hour makes a payment wait 30 minutes on average and up to 60 minutes at worst, so the 5-second promise cannot be met.
Capacity check: a scoring worker needs 0.02 seconds per payment, so it handles 1 / 0.02 = 50 payments per second. If 60 arrive each second, the backlog grows by 10 per second, or 100 after 10 seconds. A second worker brings capacity to 100 per second.
How to read it
A latency figure is read against the deadline of the use case. Average latency hides the slowest cases, so the slowest share of events is read as well. A queue that grows without bound signals that arrivals exceed capacity.
Assumptions
- Inputs arrive as individual events that can be processed independently.
- Every step meets its time budget, including calls to other systems.
Who uses it
- Payments operations analysts monitor message flows and queues, and investigate payments that stall.
- Fraud analysts tune the rules and scores that run on each payment before release.
- Data analysts build event-based feeds and compare them with scheduled batch loads.
- Cash management product managers set the response-time promises of their products.
Common confusions
- Real-time is not the same as fast. A system is real-time when it meets a stated deadline, and the deadline differs by use case.
- Near real-time usually means small batches every few minutes, not event-by-event processing.
- Streaming is an architecture for moving events continuously. Real-time is the requirement on response time.
- Real-time processing does not remove batch jobs. Reconciliation and reporting often stay in batch.