CLOUD CONCEPT

Batch Processing

Batch processing collects data into bounded groups and processes each group as a job rather than handling every record immediately as it arrives.

Cloud Concepts Hub →

What is Batch Processing

Batch processing separates data arrival from computation, allowing accumulated records to be ingested, transformed, or analyzed together. It is useful when throughput, efficient resource use, and complete datasets matter more than immediate results, such as hourly log aggregation or nightly financial reconciliation.

Batch processing operates on a bounded set of input data with a defined completion point. A batch might contain yesterday's transactions, a collection of uploaded files, or records added since the last successful run. Jobs can start on a schedule, when enough data accumulates, when an upstream dependency completes, or through an explicit request. A fixed schedule is common, but it is not required.

In cloud architectures, a typical pipeline lands source data in durable object storage, validates the inputs, transforms records using temporary compute resources, and writes results to an analytical store or another storage location. Separating storage from compute allows data to remain available between runs while processing capacity scales up for a job and scales down afterward. For example, a retailer might upload store sales throughout the day and process the completed daily dataset overnight to calculate inventory changes and revenue totals.

Ingestion frequency should follow the business freshness requirement. Daily ingestion may suit historical reporting, while hourly ingestion may support operational dashboards. An hourly schedule does not guarantee that data is available within one hour: collection delays, time until the next run, queueing, processing, and publication all contribute to end-to-end latency. When a requirement demands a reaction within seconds of an event, streaming or event-driven per-record processing is usually a better fit. Short, repeated micro-batches occupy a middle ground but still introduce buffering and execution delays.

Ingestion and transformation are separate decisions. Data can arrive continuously in storage while transformations run nightly, or a scheduled extraction can deliver a batch that is processed immediately. Exam scenarios often distinguish these choices through phrases such as daily reports, periodic uploads, large historical datasets, or near-real-time alerts. Choose the pattern from the required freshness and workload characteristics rather than assuming that all incoming data needs continuous processing.

Performance depends on more than adding workers. Partitioning inputs by date or another useful key enables independent work and reduces unnecessary reads. Columnar formats can improve analytical scans, while compressing data can reduce storage and transfer costs. Too many tiny files create scheduling and metadata overhead; poorly balanced partitions can leave most workers idle while one finishes an unusually large task. Benchmark representative input sizes and include resource startup time when estimating completion deadlines.

Reliable batch pipelines define exactly which records belong to each run. Use stable input manifests, extraction boundaries, or consistent snapshots where appropriate, and establish a policy for late-arriving records. Track completed inputs and make output writes idempotent so retries do not duplicate business results. Incremental jobs reduce repeated work, but their progress markers must advance only after successful publication. Retaining raw inputs supports backfills and correction of transformation errors.

Batch processing is not inherently cheap, slow, or limited to overnight execution. It can achieve high throughput through parallelism, but repeated full scans, idle resources, and oversized workers can waste money. Interruptible capacity can reduce compute costs when jobs tolerate retries or checkpoints. Monitor completion time, backlog, failed records, and data freshness, and ensure that sustained processing capacity can keep pace with incoming data.

Key aspects of Batch Processing

Effective batch processing combines clearly bounded inputs, an appropriate cadence, scalable execution, and reliable recovery to meet throughput and freshness requirements.

Bounded input and explicit completion

Each job processes an identifiable dataset and reaches a completion state. Define input boundaries so retries and audits can determine exactly what was included.

Frequency matched to freshness

Choose the ingestion and execution cadence from the maximum acceptable delay before results are available. Include queueing, startup, processing, and publication time rather than considering only the schedule interval.

Throughput-oriented execution

Group work to amortize startup and coordination overhead across many records. Partition data and distribute independent tasks while watching for skew and storage bottlenecks.

Decoupled storage and compute

Persist inputs independently of the resources that process them. This supports temporary compute capacity, reprocessing, and recovery without requiring sources to resend data.

Retry-safe processing

Use stable batch identifiers, tracked progress, and idempotent output operations. A retried job should not produce duplicate charges, duplicate rows, or partially published results.

Incremental processing and backfills

Process only new or changed data when repeated full scans are unnecessary. Preserve enough source history and execution metadata to handle late records and rebuild affected outputs.

Cloud services for Batch Processing

A typical AWS batch pipeline stores incoming files in Amazon S3 and uses Amazon EventBridge Scheduler to start an AWS Step Functions workflow at the required interval. The workflow validates input readiness and invokes AWS Glue for managed ETL, Amazon EMR for distributed framework workloads, or AWS Batch for custom containerized processing. These compute options are alternatives or complementary stages, not mandatory components of every pipeline. Results can be written back to S3 or loaded into an analytical destination. Workflow retries must be paired with application-level input tracking and idempotent publication to prevent duplicate or incomplete outputs.

AWS Glue image AWS Glue

AWS Glue runs managed data integration and transformation jobs, including batch ETL over data in Amazon S3 and other supported sources. Job bookmarks can track previously processed data for supported sources, but do not by themselves make downstream output writes idempotent.

Open AWS Glue →
AWS Batch image AWS Batch

AWS Batch queues and schedules containerized batch jobs onto managed compute environments. It suits custom processing programs, parallel workloads, and jobs with explicit resource requirements; the application still defines its data boundaries and transformation logic.

Open AWS Batch →
Amazon EMR image Amazon EMR

Amazon EMR provides managed environments for distributed frameworks such as Apache Spark. It applies batch processing to large-scale transformations, joins, and aggregations that benefit from distributed execution.

Open Amazon EMR →
Amazon Simple Storage Service image Amazon S3

Amazon S3 provides durable storage for raw batch inputs, intermediate data, and completed outputs. Date-based prefixes and suitable file formats help processing engines identify relevant data and avoid unnecessary reads.

Open Amazon S3 →
AWS Step Functions image AWS Step Functions

AWS Step Functions orchestrates batch pipeline stages, including supported integrations that wait for processing jobs to finish. Workflows can coordinate validation, retries, dependent jobs, and publication without performing the data transformations themselves.

Open AWS Step Functions →