Step Function and Batch

AWS Workflow and Processing Services: A Comprehensive Guide

AWS Step Functions

AWS Step Functions is a managed workflow and orchestration platform designed for coordinating AWS components. It provides a scalable and highly available solution for managing complex workflows.

Best suited for human-enabled workflows like order fulfilment or procedural requests.

Key Features

  • State Machine Definition: Allows creation of tasks, steps (parallel or sequential), decision points, and timers

  • Amazon States Language: Uses declarative JSON for configuring and documenting steps

  • Visual Interface: Provides real-time status monitoring and flow visualization

  • API Integration: Supports direct interaction with Lambda and other AWS services

  • Detailed Logging: Captures comprehensive logs for all workflow steps

State Machine Concept

Step Functions implements the finite state machine concept, where objects can assume different states throughout their lifecycle. For example, in an order processing flow:

  1. New Order → Initial state

  2. Credit Check → Moves to either Canceled or Verified state

  3. Warehouse Processing → Shipping state

  4. Delivery → Delivered state

  5. Final Processing → Either Archived or Returned state

AWS Batch

AWS Batch is designed for managing batch processing workloads on EC2 instances with flexible scaling options.

Implementation Steps

  1. Define Compute Environment

    • Choose managed or unmanaged configuration

    • Select instance types (spot or on-demand)

    • Specify virtual CPU requirements

  2. Create Job Queue

    • Assign priority levels

    • Link to compute environment

  3. Define Job

    • Create using script or JSON

    • Configure environment variables

    • Set mount points

    • Specify container images

    • Assign IAM roles

  4. Schedule Execution

    • AWS Batch handles infrastructure scaling based on workload

Service Comparison Guide

AWS Step Functions

  • Best for: Out-of-the-box coordination of AWS components

  • Ideal Use Case: Automated workflow orchestration within AWS ecosystem

  • Recommended for: New applications requiring workflow management

  • Key Strength: Native AWS service integration

Simple Workflow Service (SWF)

  • Best for: Workflows requiring manual intervention

  • Ideal Use Case: External processes or specialized logic outside AWS

  • Example: Loan applications with manual review steps

  • Note: Legacy service, Step Functions preferred for new applications

Simple Queue Service (SQS)

  • Best for: Store and forward patterns

  • Ideal Use Case: Distributing workload to worker processes

  • Example: Image resizing pipeline

  • Key Strength: Message queue management

AWS Batch

  • Best for: Recurring tasks with minimal decision logic

  • Ideal Use Case: Scheduled maintenance operations

  • Example: Daily log rotation on firewall appliances

  • Key Strength: Automated batch processing management

Exam Considerations

For AWS Certified Solutions Architect Professional examination:

  • Focus on understanding use cases rather than implementation details

  • Know when to use each service based on scenario requirements

  • Understand service relationships and integration possibilities

  • Remember that Step Functions is preferred over SWF for new applications

  • Consider manual intervention requirements when choosing between Step Functions and SWF

Last updated

Was this helpful?