This pattern shows how to run message-driven workloads at scale in the AWS Cloud by using containers and AWS Fargate.
Using containers to process data can be helpful when the amount of data an application processes exceeds the limitations of function-based serverless compute services. For example, if an application requires more compute capacity or processing time than what AWS Lambda offers, using Fargate can improve performance.
The following example setup uses the AWS Cloud Development Kit (AWS CDK) in TypeScript to configure and deploy the following resources in the AWS Cloud:
A Fargate service
An Amazon Simple Queue Service (Amazon SQS) queue
An Amazon DynamoDB table.
An Amazon CloudWatch dashboard
The Fargate service receives and processes messages from the Amazon SQS queue, then stores them in the Amazon DynamoDB table. You can monitor how many Amazon SQS messages are processed and how many DynamoDB items are created by Fargate by using the CloudWatch dashboard.
Note: You can also use this pattern’s example code to build more complex data processing workloads in event-driven serverless architectures. For more information, see Run event-driven and scheduled workloads at scale with AWS Fargate.