Choosing between batch and streaming

Choose processing patterns by decision timing, event behaviour, recovery needs and operational complexity.

Batch and streaming describe different ways to organise computation over arriving data. The useful choice depends on when a decision must be made, how events arrive and what the team can operate reliably.

This guide compares the patterns without assuming that one is inherently more advanced. A business architecture may use scheduled processing for a reviewed finance pack, continuous event handling for an operational queue and a shared semantic model across both.

Start with the decision’s time boundary

Batch processing works on a defined input scope, such as a daily delivery or a closed reporting period. Streaming handles an ongoing sequence of events, often maintaining state as each arrives. Small scheduled batches can occupy a useful middle ground when immediate processing is unnecessary.

Begin by asking how old information can be before it changes the decision. A report reviewed once a month rarely gains much from refreshing every event, while a growing operational queue may need more current visibility. Include source publication delay in this assessment.

Design dimensionBatch patternStreaming pattern
Input scopeA defined collection or periodAn ongoing sequence of events
Result boundaryCompletion of a processing runContinuously revised state or windows
Recovery focusRerun the affected input scopeRestore state and replay from a position
Late informationCorrect or rerun a periodApply an explicit late event policy
Operational focusScheduling and completion gatesBacklog, state and sustained throughput

Define time windows and late information

An event can occur at one time and arrive later. A streaming calculation grouped by event time needs a policy for when a window is considered sufficiently complete and how later events affect it. A watermark can express processing progress, but it is not proof that no older event will ever appear.

Batch workflows need similar clarity about completeness. A scheduled run starting on time does not establish that every expected source has arrived. In both patterns, define provisional results, correction behaviour and the conditions required before a result can be used for a reviewed decision.

The required decision timing determines how much freshness matters and which recovery behaviour is acceptable.

Make ordering and state assumptions explicit

Some calculations are simple counts; others maintain balances, joins or state transitions. The latter depend on record identity and ordering rules. Distributed logs such as Apache Kafka organise records into partitions, so any ordering assumption must respect the relevant partition scope rather than assume one global sequence.

If producers deliver faster than consumers can process, backlog grows. Monitor progress and the age of unprocessed information, then define how the system handles sustained pressure. Retention and recovery capacity matter because losing required historical input can make a state rebuild impossible without a new source extract.

Keep definitions consistent across processing paths

An operational estimate and a reconciled period result can legitimately differ, but their labels and definitions must explain why. Shared entity and metric definitions reduce the risk that separate batch and streaming pipelines implement subtly different business rules.

Test recovery with the full path in mind. Transactional guarantees within a log do not automatically make an external database update or notification happen exactly once. Use recoverable checkpoints, duplicate safe effects and reconciliation appropriate to the destination. Operational simplicity is a valid reason to choose a scheduled pattern.

Choosing the processing method

  1. 01

    Set the horizon

    Agree the latest useful arrival time for each decision.

  2. 02

    Inspect the source

    Understand event timing, delivery guarantees and change history.

  3. 03

    Choose boundaries

    Define windows, checkpoints, correction rules and publication states.

  4. 04

    Exercise recovery

    Verify backlog handling, replay and reconciliation before relying on the result.

Design considerations

  • Use decision timing and operating requirements to justify processing complexity.
  • Expose provisional and reconciled views with distinct, understandable labels.
  • Test late events, duplicate input and prolonged consumer interruption.

Sources

The following sources explain the underlying technical patterns.

  1. Apache KafkaDesign and delivery semanticsOpens in a new tab
  2. Cloud Native Computing FoundationCloudEvents specificationOpens in a new tab
  3. dbt LabsThe dbt Semantic LayerOpens in a new tab
  4. PostgreSQLLogical replicationOpens in a new tab

Image details

100%

Zoom in to inspect details