Stream processing treats input as an ongoing sequence rather than a dataset with a known end. A job reads from sources such as an event log, a database change feed, or newly arrived files in object storage. It can validate records, transform fields, join related events, or compute aggregates before writing results to a table, another event stream, or a serving database. A broker can buffer events and make them available for replay, but storing and forwarding events is not the same as processing them.
Choose between batch and streaming based on how soon downstream consumers need usable data, how the source exposes changes, and what the destination can guarantee. A nightly finance report that depends on a closed accounting period is usually simpler to load as a bounded batch. An inventory table that needs to reflect sales within seconds is a better fit for a stream of database changes. An initial batch snapshot followed by streaming changes can cover both needs; record a consistent change-log position for the snapshot and coordinate the handoff so changes are not missed or counted twice. Streaming is not necessarily one event at a time: a micro-batch engine processes small groups of new records while retaining progress across groups.
For time-based calculations, distinguish event time, when something happened, from processing time, when a worker handles it. A five-minute count of sensor readings usually belongs to the time the sensors recorded them, even if a device reconnects and uploads late. A watermark estimates how far event time has advanced and helps the engine decide when to close windows or discard old state. Allowing more lateness can improve completeness, but it keeps state longer and may delay final results. Decide whether events that arrive beyond the allowed lateness should be dropped, tracked separately, or reconciled later.
Recovery depends on both the processing engine and the destination. A checkpoint can record source positions and computation state so the job can resume, but it does not by itself prevent duplicate writes to an external system. If a worker writes an event and fails before recording its progress, it may replay the event. For example, a destination that upserts by stable event ID can make a replay harmless. For a table that stores the latest row per entity, also compare source versions or sequence numbers so an older replay cannot overwrite a newer value.
Streaming does not guarantee immediate results or global event order. End-to-end freshness depends on buffering, trigger intervals, computation, and destination write latency. In partitioned streams, ordering is typically guaranteed only within a partition, and a heavily used key can overload one worker even when others have spare capacity. Monitor the age of unprocessed events, checkpoint health, and state growth against the freshness target. If hourly updates already meet that target, a scheduled incremental batch can offer simpler recovery and lower operating cost.