Real-Time Analytics Architecture: When Streaming Beats Batch (and When It Does Not)
Real-time is one of those phrases that sells a project before anyone has asked whether it is needed. A stakeholder sees a live dashboard somewhere, decides their data should be real-time too, and suddenly a perfectly good nightly pipeline is being torn out and replaced with streaming infrastructure that costs more, breaks more, and delivers data nobody looks at until the morning anyway.
Real-time analytics is genuinely transformative for the right problems and an expensive mistake for the wrong ones. The discipline that separates the two is honest about a single question: how fresh does the data actually need to be at the moment a decision is made? This article walks through that question, the architecture that real-time requires, and the cost trade-offs you should weigh before committing.
Define the latency you actually need
Before choosing any technology, write down the decision the data supports and how stale that data can be without hurting the decision. This is the most important step, and it is the one teams skip.
- Seconds matter: fraud detection at the point of transaction, fulfillment routing, live operational monitoring, anything where a delayed reaction causes real loss. These genuinely need streaming.
- Minutes are fine: a live operations dashboard a team glances at through the day, inventory levels, marketing performance during a campaign push. Micro-batch covers these comfortably and far more cheaply.
- Hours or a day are fine: executive reporting, weekly trends, most financial reconciliation, the vast majority of analytics. Batch is correct here, and reaching for streaming is pure waste.
The honest answer for most use cases is hours, not seconds. When you force the question, the supposed need for real-time often evaporates. Reserve real-time for decisions where the freshness directly changes the outcome, and you will spend your engineering budget where it earns a return.
Batch, micro-batch, and streaming
These are three points on a spectrum of how often and how quickly data moves from source to consumption.
Batch
Batch processing runs on a schedule, moving and transforming a chunk of data at a time (nightly, hourly). It is simple, cheap, mature, and easy to reason about. If a job fails, you rerun it. If the logic is wrong, you reprocess the batch. The vast majority of analytics has always run this way for good reason. The cost is freshness: consumers see data as of the last run, not as of now.
Micro-batch
Micro-batch shrinks the schedule to small, frequent intervals (every few minutes). It feels nearly real-time to a human watching a dashboard while keeping most of the operational simplicity of batch. For a large share of "we want real-time" requests, micro-batch is the right answer: it delivers the perceived freshness people actually want without the full weight of streaming infrastructure. We reach for this constantly as the pragmatic middle ground.
Streaming
Streaming processes each event as it arrives, continuously, with latency measured in milliseconds to seconds. It is the only option when a decision truly cannot wait. It is also the most demanding to build and operate: the system runs forever, must handle events arriving late or out of order, and turns failures into a much harder problem because there is no tidy batch to simply rerun.
The components of a real-time architecture
A streaming analytics system generally has three moving parts beyond the source systems that emit events.
- The event bus: a durable, ordered log that ingests events and lets multiple consumers read them. This is the backbone. It decouples producers from consumers and buffers spikes so a burst of traffic does not knock anything over. It also holds events long enough that a failed consumer can recover by replaying from where it left off.
- The stream processor: the engine that reads events and does the work: filtering, enriching, aggregating over time windows, scoring with a model, detecting patterns. This is where the analytical logic lives, and where most of the operational complexity concentrates, because it must handle state, time, and ordering correctly.
- The serving layer: where processed results land so they can be consumed. This might be a low latency store the dashboard queries, an API that returns the latest computed value, or a write back into the operational system that triggered the event. The serving layer determines what real-time feels like to the end consumer.
Around these sit the unglamorous but essential concerns: handling late and out of order events, deciding what happens when something is processed twice, and monitoring a system that, unlike a batch job, never finishes and so never gives you a clean success signal.
The cost trade-offs nobody mentions upfront
Streaming costs more than batch on every axis, and the costs compound. It is worth naming them plainly before a project commits.
- Infrastructure cost: always on systems run around the clock whether or not data is flowing. A nightly batch job uses compute for an hour. A stream processor uses it for all twenty four.
- Engineering cost: streaming requires scarcer skills and more careful design. Time semantics, state management, and exactly once processing are genuinely hard, and getting them subtly wrong produces results that look fine and are quietly wrong.
- Operational cost: a continuous system needs continuous attention. There is no maintenance window where nothing is running. Debugging a live stream is harder than rerunning a failed batch, and on call expectations rise.
- Correctness cost: batch can be reprocessed cleanly when logic changes. Reprocessing a stream's history is a project in itself, so mistakes are more expensive to fix after the fact.
None of this argues against real-time. It argues for deploying it deliberately, on the decisions that genuinely need it, with eyes open to what it asks of the team. We frequently help companies right-size this choice, often delivering a micro-batch design that gives stakeholders the freshness they actually wanted at a fraction of the cost they expected. You can read more about how we approach architecture work on our services page.
A simple decision rule
When someone asks for real-time, ask back: what decision does this serve, and what breaks if the data is an hour old? If nothing breaks, build batch. If a few minutes of delay is acceptable, build micro-batch and call it real-time, because to the user it is. Reserve true streaming for the cases where milliseconds change the outcome and the value clearly justifies the always on cost. That single discipline will save you more money and grief than any technology choice.
Takeaways
- Define required latency by the decision before choosing any technology. The honest answer is usually hours.
- Batch is cheap and simple, micro-batch covers most perceived real-time needs, streaming is for decisions that truly cannot wait.
- Streaming architecture means an event bus, a stream processor, and a serving layer, plus the hard problems of time, ordering, and never ending operation.
- Streaming costs more on infrastructure, engineering, operations, and correctness. Deploy it deliberately.
Want analytics that actually moves the number?
Beryl Analytics builds predictive models, data pipelines, and dashboards that drive decisions for businesses across New Zealand and Australia. We ship to production and prove the return.
Talk to Beryl Analytics