Batch, Streaming and Event-Driven Data Architecture
A practical guide for enterprise data modeling and architecture.
Batch is effective when data can arrive on a schedule and work benefits from bounded runs, bulk efficiency or simple reruns. Define the data interval, completeness signal, late-data policy and whether rerunning is safe. A short schedule may feel near-real-time while remaining batch.
Batch processing
Batch is effective when data can arrive on a schedule and work benefits from bounded runs, bulk efficiency or simple reruns. Define the data interval, completeness signal, late-data policy and whether rerunning is safe. A short schedule may feel near-real-time while remaining batch.
Streaming processing
Streaming can reduce delay and support continuous reactions, but requires handling state, duplicate delivery, event-time variation, backpressure, recovery and monitoring. Treat exactly-once as a specific end-to-end guarantee with a defined scope, not an assumption based on a product label.
Event-driven integration
Events describe occurrences and allow producers and consumers to evolve with looser timing coupling. They need stable meaning, producer ownership, versioning and subscriber failure handling. Decide how consumers recover missed events and whether retained history or reconciliation is available.
Choose and combine
Quantify acceptable end-to-end delay. Consider source rate, ordering and replay support. Estimate operational skills and recovery burden. Define how batch corrections reconcile with streaming state, and measure freshness and correctness from source to consumer.
Keep authority clear
A common architecture uses streaming for time-sensitive signals and batch for backfills, reconciliation or heavier transformations. Define which representation is authoritative for each use and how discrepancies are resolved.
Apply the idea
Validate the definitions and design choices with the people who own the process and the consumers who rely on the data. Record assumptions, examples and unresolved questions. Continue through the related guides in this section to connect the concept to implementation and governance.
Choose processing mode by latency and change
Batch processing groups work over a bounded interval; streaming handles ongoing events; event-driven architecture communicates changes to interested consumers. These patterns can be combined. Define required freshness, event volume, ordering, replay and consumer behavior before selecting a mode.
Design event contracts and delivery
Specify event identity, subject, occurrence time, source, schema version and correction behavior. State delivery guarantees and what consumers do with duplicates or out-of-order events. “Exactly once” claims depend on system boundaries; validate the complete path and business effect rather than relying on a single component setting.
Handle state, replay and projections
Events can feed current-state projections, analytical facts or operational notifications. Define how projections are rebuilt, how late events change prior results and how consumers know a replay occurred. Make processing idempotent and keep checkpoints recoverable.
Operate batch and streaming together
Monitor freshness, backlog, failed events, replay progress, cost and output quality. A streaming path may need a batch reconciliation or backfill path. Document ownership, failure response, consumer lag and retention. Test source outages, poison records and schema changes.
- Are latency and ordering needs quantified?
- Are events uniquely identified and versioned?
- Can consumers replay without duplicate effects?
- Are current state and historical events distinct?
- Are lag and failure recovery observable?
Worked example: combine streaming and batch
A delivery service can publish a low-latency provisional count from events and a later reconciled count from a complete batch. Define the event identity, watermark or cutoff, correction policy, and transition between views. Consumers need to know whether a number is provisional, when it becomes final, and how restatements are communicated.
Streaming requires state, ordering, replay, and continuous monitoring; batch requires schedules, backfills, and completion checks. An event-driven integration also needs idempotency and consumer isolation. Preserve raw events and run context where approved so the output can be rebuilt. Measure end-to-end latency and correctness together.
Select a combined processing contract
Specify delivery guarantees, late arrival handling, deduplication, failure recovery, and source of truth. Test burst load and partial outage. Avoid maintaining two paths unless they serve distinct needs and have a clear reconciliation rule. Review complexity and cost after operational evidence accumulates.
Operate event processing reliably
Monitor event lag, throughput, duplicates, dead-letter volume, schema compatibility, and consumer checkpoints. Define ownership for replay and poison-message handling. Preserve event identity and ordering context. Test that one consumer's failure does not block unrelated consumers unless ordering or consistency requires it.
Publish delivery and finalization semantics to downstream users. Review retention of replay data and ensure deletion policy is respected. Scale and partition based on measured skew, not only average throughput.
Assign processing pattern ownership
Name the owner for schedule or event delivery, schema compatibility, replay, monitoring, and consumer support. Define retention of replay data and who approves backfills. Set service expectations for freshness and correction.
Exercise outages and retries with consumers. Review whether the selected pattern still fits as event volume and latency needs change.