AWS · Compute

AWS Batch

Runs batch computing jobs at any scale by queuing them and provisioning the right EC2, Spot or Fargate capacity automatically.

On the SAA-C03 exam listAutomationServerless

What it is and what problem it solves

AWS Batch runs containerised jobs. You submit jobs to a job queue; Batch places them on a compute environment that it scales up and down for you, using EC2 (On-Demand or Spot), Fargate or EKS. It handles priorities, retries, array jobs (many copies of one job over different inputs) and dependencies between jobs, so a pipeline runs in the right order.

When to use it

  • Large numbers of independent jobs: simulations, genomics, rendering, financial risk runs, data processing.
  • Jobs longer than Lambda's time limit or needing GPUs or lots of memory.
  • You want Spot savings without managing interruption handling yourself.

When to avoid it

  • Short, event-driven tasks: Lambda is simpler.
  • Long-running services: ECS or EKS services.
  • Workflow logic with branching and human steps: Step Functions can orchestrate Batch jobs instead.

Limits and quotas

ItemValueContextSource
Job queues per account 50
Fixed limit
Source
checked
Compute environments per account 50
Fixed limit
Source
checked
Array job size 10,000 child jobs
Fixed limit
Source
checked
Dependencies per job 20
Fixed limit
Source
checked

Quotas and limits change. Check the linked source before designing around a number.

Cost model

What you pay for

There is no additional charge for AWS Batch. You pay for the EC2 instances, Spot capacity, Fargate or Lambda resources the jobs use, with Savings Plans and Spot discounts applying.

Where it is cost-efficient

Interruptible jobs on Spot capacity, and compute environments that scale to zero between runs.

Where costs grow

Compute environments with a minimum vCPU above zero, and jobs that request far more memory or vCPU than they use.

Cost controls and common surprises

Set minimum vCPUs to zero, use Spot with allocation strategies that pick plentiful capacity, and right-size job definitions.

Prices differ by Region and change over time; see the pricing page linked under Sources.

Security

Controls the service provides

Jobs run as containers with an IAM job role; compute runs in your VPC subnets with your security groups.

What you configure

Give each job definition a least-privilege role, keep compute in private subnets, and store secrets in Secrets Manager.

Logging and monitoring

Job logs to CloudWatch Logs; job state changes to EventBridge; CloudTrail for API calls.

Related security services

ECS, EKS, EC2, Fargate, Step Functions, EventBridge.

Shared responsibility

AWS schedules and scales. You secure the container images, roles and data.

Common service combinations

S3 for input and output, Step Functions to orchestrate, EventBridge schedules, ECR for images, FSx for Lustre for high-throughput shared storage.

Business application examples

  • A genomics lab processes thousands of samples overnight on Spot instances.
  • A bank runs risk calculations as an array job of 5,000 scenarios.

Exam cues and common confusions

  • Batch jobs at scale, managed scheduling, Spot: AWS Batch.
  • Jobs longer than 15 minutes go to Batch or containers, not Lambda.

Related

Courses and lessons

Services, comparisons and patterns

Sources

Independent study material, not affiliated with or endorsed by Amazon Web Services. AWS and service names are trademarks of Amazon.com, Inc. or its affiliates.

Last reviewed · By the ByteCamel team · How we write content

Was this page helpful?

Report a mistake