Guide
Batch and real-time processing: when to use each
What each mode is good at, why most organisations need both, and how to keep their results consistent.
Two ways to process
Batch processing takes a large set of records and works through all of them, usually on a schedule. Real-time processing handles one record or event as it arrives and returns a result in seconds or less.
Neither is better. They answer different needs.
What batch is good at
- Completeness. Every record is considered together, so entities and networks are globally consistent.
- Heavy computation. Community detection across a whole graph, or retraining a model, needs the full dataset.
- Reprocessing. When a rule changes, history can be replayed through it.
- Cost. Work can be scheduled when capacity is cheap.
What real time is good at
- Decisions in the moment. Approving an application, holding a payment, routing a claim.
- Freshness. An investigator sees the transaction that happened a minute ago.
- Customer experience. A good customer gets an answer immediately.
Let the decision set the latency
| Decision | Useful latency | Mode |
|---|---|---|
| Approve an online application | Under a few seconds | Real time |
| Hold an instant payment | Well under a second | Real time |
| Refer a new claim for investigation | Minutes | Real time or small batches |
| Review customer risk ratings | Daily | Batch |
| Rebuild ownership hierarchies | Daily or weekly | Batch |
| Retrain a model | Monthly or on drift | Batch |
Asking for real time where a daily run would do adds cost and complexity for no benefit.
Why most organisations need both
Real-time decisions depend on context that only batch can build. To score an application in a second, the system must already know the entities, networks and features that the application will be compared against. Batch builds that picture; real time adds one record to it and reads off the answer.
Keeping the two consistent
The classic failure is two code paths with two sets of rules, which slowly drift apart until the overnight result contradicts the one given to the customer at lunchtime. Avoid it by design:
- One set of cleansing rules. A record must look the same whichever way it arrived.
- One set of matching rules. A new record should join the same entity in real time that batch would give it.
- One definition of each feature. Calculated ahead of time for speed, and updated incrementally when an event touches it.
- Reconciliation. Let the next batch run confirm or correct what real time decided, and report the differences.
Keeping real-time work small
Latency budgets are met by doing less at decision time:
- Precompute features and store them where they can be read quickly.
- Limit matching to candidates found by a few keys.
- Update only the entities and features an event touches.
- Return the explanation with the score, so that no second call is needed.
Planning capacity
Batch capacity is driven by total volume and how often you rebuild. Real-time capacity is driven by peak events per second and the response time you promise. Size them separately, and test both with realistic data before going live.
See how the Inselu Platform handles both modes.