Queue-Based Architecture
Amazon SQS is a fully managed
message
queuing service
Amazon SQS is often orchestrated with AWS CLI or AWS SDK scripted solutions for the deployment of applications from the desktop without users interacting with AWS components directly. A queue-based architecture with Amazon SQS and Amazon EC2 requires self-managed compute infrastructure, in contrast with a service-managed deployment, such as AWS Batch.
A queue-based architecture is best for loosely coupled workloads and can quickly become complex if applied to tightly coupled workloads.
Reference Architecture

Figure 3: Amazon SQS deployed for a loosely coupled workload
Workflow steps:
-
Multiple users submit jobs with the AWS CLI or SDK.
-
The jobs are queued as messages in Amazon SQS.
-
EC2 Instances poll the queue and start processing jobs.
-
Amazon SQS emits metrics based on the number of messages (jobs) in the queue.
-
An Amazon CloudWatch alarm is configured to notify Auto Scaling if the queue is longer than a specified length. Auto Scaling increases the number of EC2 instances.
-
The EC2 instances pull source data and store result data in an S3 bucket.