# Batch-vs-Stream

> An approach in which the processing model, periodic batch or continuous stream, is chosen by how fresh the data must be.

Record: `architecture:batch-vs-stream`
Kind: approach
Layer: [Execution Core](https://banes-lab.com/records/layer/execution-core.md)
Severity: contextual
Scope: data processing, latency, architecture
Canonical: https://banes-lab.com/ontology#architecture-batch-vs-stream

Listed in [Architecture principles](https://banes-lab.com/api/records/architecture.md), after [Fan-out/Fan-in](https://banes-lab.com/records/architecture/fan-out-fan-in.md) and before [Plugin Architecture](https://banes-lab.com/records/architecture/plugin-architecture.md).

## Repair

- Refactored by: Choose Batch or Stream by Latency Need
- Detected by: batch cadence mismatched to freshness requirements
- Violated by: low-latency needs served by periodic batch jobs
- Measured by: data-freshness lag vs requirement
- Enforced by: data architecture review

## Requires

- [Latency Requirement Clarity](https://banes-lab.com/records/lexicon/latency-requirement-clarity.md)

## Reinforces

- [Fitness for Purpose](https://banes-lab.com/records/lexicon/fitness-for-purpose.md)

## Enables

- [Latency-Appropriate Processing Model](https://banes-lab.com/records/lexicon/latency-appropriate-processing-model.md)

## Conflicts with

- [One-Size-Fits-All Processing](https://banes-lab.com/records/lexicon/one-size-fits-all-processing.md)

## In tension with

- [Operational Duplication](https://banes-lab.com/records/lexicon/operational-duplication.md)

## Tensions

- [Batch-vs-Stream / Operational Duplication](https://banes-lab.com/records/tension/batch-vs-stream-operational-duplication.md)

## Severity

- [contextual](https://banes-lab.com/records/vocabulary/severity-contextual.md)

## Category

- [Streaming / Pipeline / Dataflow Processing](https://banes-lab.com/records/architecture-category/streaming-pipeline-dataflow-processing.md)

## Linked from

- [Streaming / Pipeline / Dataflow Processing](https://banes-lab.com/ontology/lexicon/lexicon-category-streaming-pipeline-dataflow-processing.md)
- [Severity levels](https://banes-lab.com/ontology/schema/the-vocabulary-severity.md)
- [The resolutions](https://banes-lab.com/ontology/schema/the-resolutions.md)
