0

We have an existing EC2 based application that we are migrating to a serverless compute model to seeve the API requests. We also need to process around 3k SQS messages/second coming into our SQS queue (with an average processing time of 600ms/message).

Which serverless compute model should we use for the SQS poller, Lambda v/s ECS Fargate?

If we batch the messages to 25, we will need around 120 instances of the Lambda function. Is there a way to process them in parallel in Java (could only find Python reference)?

Is using Fargate a better approach? (Lambda for API traffic and ECS for SQS polling?)

Using Reserved concurrency on Lambda can be used to limit the number of pollers.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • Amazon SQS only supports a maximum batch size of 10 (not only for Lambda functions, but for anything calling `ReceiveMessage()`. Lambda should work perfectly well and will auto-scale regardless of your chosen language, but Java has a longer cold-start time when creating a new Lambda container. Lambda has the benefit that the function will only be triggered when there are messages available and Lambda will automatically delete the messages after successful completion of the function. – John Rotenstein Jul 10 '23 at 06:52

0 Answers0